1. Between ... and ...
select * from goods where sdate between to_date('2012-5-10','yyyy-mm-dd') and to_date('2012-5-11','yyyy-mm-dd') order by sdate desc
2. 时间比较
select * from goods where sdate>to_date('2012-05-09', 'yyyy-mm-dd')
3.匹配符:
- 代表一个字符
% 代表多个字符
-- 查找'00'作为后两位的值
select * from salary_table where salary like '-00'
-- 查找'200'作为前三位的数值
select * from salary_table where salary like '200%'
阅读(2692) | 评论(0) | 转发(0) |