关于字段匹配的问题~~ 需要在table表中查特定时间的信息(假定时间为sysdate吧)~如果时间不存在,则查找特定时间-1天的信息(即sysdate-1的信息),请问怎么查找呢?~~~select * from table where rq=(select distinct decode(rq,sysdate,syadate,sysdate-1) from table)~~~这样好像不行哎~~那位高人帮帮忙~~先谢谢了~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from table where rq=(case when (select Count(1) from table where rq=sysdate)>0 then sysdate else sysdate-1 end); rq 保存的精度是什么 是到年月日时分秒还是年月日select * from table where rq in(select distinct decode(rq,sysdate,syadate,sysdate-1) from table) 这样试过了,假如不存在的话可以的,但是sysdate在表中存在的话就会返回sysdate和sysdate-1对应的信息了~~ O(∩_∩)O谢谢gelyon了~就是这个效果,好厉害呀~~~我什么时候跟你一样厉害呢?~~~~(*^__^*) 嘻嘻…… sql语句查询问题 oracle能否在一般机子上跑起来 过程参数不能传递空格码??? oracle的安装文件丢了怎么办? 请教一条PL/SQL sql语句问题 关于unknown nls parameter specified 出错! 我安装完oracle10g 后, 打开http://localhost:5500/em 一般情况下就会弹出一个登陆框, 可是现在却提示要重新启动数据库 那个+是什么意思???? 各位师兄:我在java中连接oracle数据库,出现了点问题,请问是什么原因,谢谢! 面试问题 求教 sql 优化方法
select * from table
where rq=(case when
(select Count(1) from table where rq=sysdate)>0
then sysdate
else sysdate-1
end)
;
select * from table where rq in(select distinct decode(rq,sysdate,syadate,sysdate-1) from table)