zoukankan      html  css  js  c++  java
  • where 条件查询

    比较运算符

        >     <     <=     >=     <>    !=

    select   *    from   employee    where   sex='male';

    select   *   from  employee  where   id>10;

    select * from employee where salary between 10000 and 20000;

    select * from employee where salary in (10000,20000);   单独的n个值

    范围

      between  10000   and   20000;      10000到20000之间

      in  (10000,20000)    只有10000或者20000

    模糊匹配

        like    

          %  通配符  表示任意长度的任意内容

          _   通配符   一个长度的任意内容

            select * from employee where emp_name like '程__';

          select   *   from   employee  where   emp_name like 'j%';    

          select * from employee where emp_name like '%l%';     含有l

        regexp    必须是字符串

          select * from employee where emp_name regexp '^j';     以j开头的。

            ‘g$’   以g结尾的

    逻辑运算

        not

            select   *  from  employee  where   salary   not   in  (1000,20000)  and  age =18;

            select    *   from   employee    where   sex='male'  or   post='teacher';

        and

        or

        not

    查看岗位描述部位null

          不能用=     只能用  is     

              select  *   from  employee    where    post_comment    is   not   null;

  • 相关阅读:
    linux创建www用户组和用户
    php+nginx改为socket
    laravel重写
    centos7精简版(minimal)killall: command not found
    php+nginx 整合
    php编译安装
    Nginx的编译安装
    sql 中常见的控制流语句
    sqlserver 中常见的函数 数学函数
    sqlserver 中常见的函数字符串函数
  • 原文地址:https://www.cnblogs.com/ch2020/p/12898007.html
Copyright © 2011-2022 走看看