= >=,逻辑运算(and or not),between xxx and xxx,
where id (not)in(1,2,3,4)查询id在1234中的,
is(not) null 可以查询某个字段为空...可省) join
右外连接(右边为主,右找左,左边无,左则为空)
right (outer可省) join
全外连接
full (outer可省) join
正常的匹配,不正常的左边为空的显示,右边为空的也显示...default 实际值,要与字段类型匹配
4,约束(字段级约束)
主键,例:如学号,但若学生学号 用1,2,3,4,5, primary key
唯一,表示该类内容不可重复,但可同时为空,unique...t where num is null可以在num上设置默认值0,确保表中num列没有null值,然后这样查询:select id from t where num=0
应尽量避免在 where 子句中使用...= 'seven'; select * from tb1 where nid = 1 or email = 'seven@live.com' and name = 'alex' - 类型不一致 如果列是字符串类型