where 条件筛选:
select * from s1 where age>18;(筛选出表s1中年龄大于18的)
select * from s1 where age>18 and grade=A;(筛选出表s1中年龄大于18且等级为A级的)
select * from s1 where age between 20 and 22;(筛选出表s1中年龄处于20--22的)
like 模糊查询:
查询以指定字符串开头的值
语法格式:SELECT * FROM 表 WHERE 列 LIKE '指定字符串%'
查询以指定字符串结束的值
语法格式:SELECT * FROM 表 WHERE 列 LIKE '%指定字符串'
示例:SELECT * FROM user WHERE name LIKE '%wsnk'
查询包含指定字符串的值
语法格式:SELECT * FROM 表 WHERE 列 LIKE '%指定字符串%'
示例:SELECT * FROM user WHERE name LIKE '%wsnk%'