基本查询语句: select */列1,列2... from 表名spa
条件查询(过滤查询): select */列1,列2... from 表名 where 条件scode
--- between...and...在某个取值范围之间 blog
--- is null 是空 排序
--- like 模糊查询(_表明1个字符 %表明n个字符)class
--查询emp表中名字的最后一个字为'花'的员工信息 select * from emp where ename like '%花'; --查询emp表中名字的最后一个字为'花'且名字为两个字的员工信息 select * from emp where ename like '_花';
desc 降序 asc升序 若是不写默认为升序排列select
--查询20号部门的员工 而且员工的工资大于1000 按照员工的编号的降序排序显示 select * from emp where deptno=20 and sal>1000 order by empno desc; --查询员工信息中管理者不为null的员工中,员工为10号部门员工或者查询绩效为null而且工资大于2000的员工 select * from emp where mgr is not null and (deptno=10 or comm is null and sal>2000);