根据条件搜索结果。
select * from info where age > 30;select * from info where id > 1;select * from info where id = 1;select * from info where id >= 1;select * from info where id != 1;select * from info where id between 2 and 4; -- id大于等于2、且小于等于4select * from info where name = 'deepwind' and age = 19;select * from info where name = 'gini' or age = 49;select * from info where (name = 'mufeng' or email="598779784@qq.com") and age=30;select * from info where id in (1,4,6);select * from info where id not in (1,4,6);select * from info where id in (select id from depart); # 子查询# select * from info where id in (1,2,3);# exists select * from depart where id=5,去查数据是否存在,如果存在,如果不存在。select * from info where exists (select * from depart where id=5);select * from info where not exists (select * from depart where id=5);select * from (select * from info where id>2) as T where age > 10; # 临时表T
select * from info where id > 10;
