根据条件搜索结果。

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