17,377
社区成员
发帖
与我相关
我的任务
分享
select in_time from work_task
where (state=190) and in_time>to_date(to_char(add_months(sysdate,-12),'yyyy-mm'),'yyyy-mm') and rownum<=1 order by in_time desc
with t_test as(
select to_date('2010-03-23 22:39:33','yyyy-mm-dd hh24:mi:ss') dd from dual union all
select to_date('2010-03-23 17:43:31','yyyy-mm-dd hh24:mi:ss') from dual union all
select to_date('2010-03-23 17:31:17','yyyy-mm-dd hh24:mi:ss') from dual)
select *
from (select * from t_test
order by dd desc)
where rownum = 1;