1、基本查询条件
l 数值比较:字段类型必须数据数值类型
= != < <= > >=
exp:
select username from usertab where uid=10;
select id,username,uid from usertab where uid=1001;
select * from usertab where id<=10;
l 字符比较 / 匹配空 / 非空
= 相等; != 不相等
匹配空 字段名 is null
匹配非空 字段名 is not null
exp:
select username from usertab where username="apache";
select username,shell from usertab where shell!="/bin/bash";
update user1 set uid=132 where uid is null;
select name,uid from user1 where uid is not null;
l 逻辑比较(就是有个查询条件)
逻辑与 and 多个条件同时成立 才匹配
逻辑或 or