17,086
社区成员
发帖
与我相关
我的任务
分享
--用to_date(date,format)函数
create table t(
col_1 number(2),
col_2 varchar2(20));
--
insert into t
select 10,'2011-01-01' from dual union all
select 11,'2011-02-02' from dual union all
select 15,'2011-03-05' from dual union all
select 20,'2011-04-21' from dual union all
select 54,'2011-04-22' from dual;
--
SQL> select * from t
2 where to_date(col_2,'yyyy-mm-dd')<=to_date('2011-03-05','yyyy-mm-dd');
COL_1 COL_2
----- --------------------
10 2011-01-01
11 2011-02-02
15 2011-03-05