select ceil(sysdate -
to_date(concat(to_char(makedate, 'yyyy-MM-dd'), maketime),
'yyyy-MM-dd hh24:mi:ss'))*24*60 as plminute from tccontprintinfo;
数据库表中时间与当前时间差的分钟数
如何让plminute跟常量比较,比如:比较 数据库表中时间与当前时间差的分钟数 大于 10分种
select t.name, t.makedate,t.maketime from temp t where
and ceil(sysdate -
to_date(concat(to_char(makedate, 'yyyy-MM-dd'), maketime),
'yyyy-MM-dd hh24:mi:ss'))*24*60 >20;
这样好像不行
------解决方案--------------------
为什么要用ceil?
select t.name, t.makedate, t.maketime
from temp t
where (sysdate -
to_date(to_char(makedate, 'yyyy-MM-dd')
------解决方案--------------------
' '
------解决方案--------------------
maketime,
'yyyy-mm-dd hh24:mi:ss')) * 24 * 60 > 20;