时间:2021-07-01 10:21:17 帮助过:24人阅读
select *from emp where name=‘kw‘
查询2018年1月4日入职的员工,注意oracle默认日期格式(DD-MON-RR表示2位的年份)
select * from emp where hiredate = ‘4-1月-18‘;
select * from emp where age > 20;
select *from emp where age<>20;
select *from emp where (age>20) and (age <25);
或者
select *from emp where age between 20 and 25;
select *from emp where age NOT between 20 and 25;
总结:between……and……,小数据必须在前,大数据在后。
不等于符号<>或者!=
select *from emp where name=‘kw‘ or name=‘wq‘;
或者
select *from emp where name in (‘kw‘,‘wq‘);
select *from emp where name like ‘k%‘ --匹配0个,1个或者多个
select *from emp name like ‘%w‘‘
select *from emp where name like ‘k%q‘
select *from emp where name like ‘k_q’;
select *from emp where name like ‘k_‘ escape ‘\‘;
select *from emp where comm is null;
select *from emp where (comm is null) and (sal>1000);
select *from emp where sal in(100,200,300,400);
Oracle数据库(三)
标签:日期 需要 必须 escape pos name div 数据 查询