python day37
今日内容 基本查询语句及方法 from where group by having distinct order by limit .... 书写顺序格式: select id,name from emp where id > 3 and id < 6; 执行顺序格式: from # 确定到底是哪站表 where # 根据过来条件 筛选数据 select # 拿出筛选出来的数据中的某些字段 当表字段特别多的时候 结果的排版可能会出现混乱的现象,你可以在查询语句加\G来规范查询结果 select * from emp\G; 查询练习: # 1.查询id大于等于3小于等于6的数据 select * from emp where id >= 3 and id <= 6; select * from emp where id between 3 and 6; # 上述语句完全等价 # 2.查询薪资是20000或者18000或者17000的数据 select id,name from emp where salary = 20000 or salary = 18000 or salary = 17000; select id,name from emp where salary in (20000,18000,17000); # 3.查询员工姓名中包含o字母的员工姓名和薪资