条件筛选 where

  1. 除了**insert**以外的三个语句都可以筛选
  2. **where**是一个关键字 拼接在除了**insert**语句以外的其他语句基本结构之后
    1. **delete form 表 where...;**
    2. **update 表 set 列 = 值 where...;**
    3. **select * from 表 where...;**

  1. **where的使用**
    1. **比较运算符号:> >= < <= = !=**
      1. **select * from person where age > 19;**

  1. 算数运算符号:+ - * /
    1. **select * from person where age + 2 = 20;**

  1. 逻辑运算符号: and or not
    1. **select * rom person where age = 10 and sex = '男'**
    2. 如果**and****or**同时出现 **and**的优先级更高

  1. **[not] between ... and ... ** 在…之间
    1. 包含两端的值
    2. **select * from person where age between 18 and 20;**

  1. **[not] in()**满足括号里其中一个就行
    1. **select * from person where age in (10,20);**

  1. **[not] like**模糊查询
    1. **%** 用来替代**0-n**个字符
    2. **_**用来替代**1**个字符有且只有一个
    3. **select * from person where name like '%a%';**

      排序

      order by

      升序排列 asc 默认就是升序
      降序排列 desc