• SQL语句


    1、DISTINCT
    SELECT DISTINCT 列名称 FROM 表名称
     
    2、!= 和 not
    select * from emp where job != 'clerk';
    select * from emp where not job = 'clerk';
     
    3、between ... and
    oracle中日期格式;
    1981年出生的雇员信息;
    select * from emp where hierdate between '01-1月-1981' and '31-12月-1981'
     
    4、is null 和 is not null 和 not 字段 is null
    select * from emp where comm is null;
    select * from emp where comm is not null;
    select * from emp where not comm is null;
     
    5、in 和 not in
    在in中使用null对结果没有影响;
    在not in中使用null 则查不到任何数据;
    select * from emp where empno = 7369 or empno = 7499 or empno = 8899;
    select * from emp where empno in (7369,7499,8899);
     
    6、like子句的用法
    _匹配任意一个任意字符;
    %匹配0个、1个或多个任意字符;
    select * from emp where ename like '_a%';
  • 相关阅读:
    洛古模拟赛--星空
    bzoj4476 [Jsoi2015]送礼物
    矩阵乘法总结
    bzoj 3167 SAO
    codeforces 671D
    10.28
    noip前集训
    10.2晚 模拟继续
    10.2 考试
    10.1 国庆 考试
  • 原文地址:https://www.cnblogs.com/Lemon-ZYJ/p/9324058.html
Copyright © 2020-2023  润新知