select [ALL|DISTINCT] select_list
from table_list [where search_conditons]
[group by group_by_list]
[having search_conditons]
[order by asc|desc]
消除重复行查询:
select distinct job from emp;
使用别名查询
select ename 名字,job 工作 from emp;
select *from emp where sal between 1500 and 300;
select *from emp where comm is not null;
select *from emp where empno in(7369,7566,7799);
select *from emp where empno not in(7369,7566,7799);
查询雇员信息以字母A开头
select *from emp where ename like 'A%';
第二个字母是A的全部信息
select *from emp where ename like '_A%';
模糊查询:
(模糊查询 )查询名字中带有字母A的全部雇员信息;(%%不带有任何的的关键字表示查询全部的记录)
select *from emp where ename like '%A%';