--查看数据 select col_name from table_name where date_col<to_date('2008-06-30','yyyy-mm-dd');--删除数据 delete from table_name where date_col<to_date('2008-06-30','yyyy-mm-dd');
---查看2008年6月30日之前的数据 select col_name from table_name where date_colname<to_date('2008-06-30','yyyy-mm-dd') ---删除2008年6月30以后的数据 delete from table_name where date_colname>to_date('2008-06-30','yyyy-mm-dd')
很简单的where就可以了啊……
查询 SELECT * FROM 表名 WHERE 日期列名<to_date('20080630','YYYYMMDD'); 删除 DELETE FROM 表名 WHERE 日期列名<to_date('20080630','YYYYMMDD');
select col_name
from table_name
where date_col<to_date('2008-06-30','yyyy-mm-dd');--删除数据
delete from table_name
where date_col<to_date('2008-06-30','yyyy-mm-dd');
select col_name from
table_name
where date_colname<to_date('2008-06-30','yyyy-mm-dd')
---删除2008年6月30以后的数据
delete from table_name
where date_colname>to_date('2008-06-30','yyyy-mm-dd')
查询
SELECT * FROM 表名
WHERE 日期列名<to_date('20080630','YYYYMMDD');
删除
DELETE FROM 表名
WHERE 日期列名<to_date('20080630','YYYYMMDD');