select *
from t_supplier_order a
where a.so_status = 0
and ceil(((To_date(sysdate, 'yyyy-mm-dd hh24:mi:ss') -
To_date(a.so_ordertime, 'yyyy-mm-dd hh24:mi:ss'))) * 24 * 60) >= '10'两个时间按照分钟来相减 结果报literal does not match format string 文字不符合格式,坐等大牛 谢谢
from t_supplier_order a
where a.so_status = 0
and ceil(((To_date(sysdate, 'yyyy-mm-dd hh24:mi:ss') -
To_date(a.so_ordertime, 'yyyy-mm-dd hh24:mi:ss'))) * 24 * 60) >= '10'两个时间按照分钟来相减 结果报literal does not match format string 文字不符合格式,坐等大牛 谢谢
a.so_ordertime,我想也是date类型
那只需要直接相减就可以了啊。select *
from t_supplier_order a
where a.so_status = 0
and ceil(SYSDATE - a.so_ordertime * 24 * 60) >= '10'
a.so_ordertime 同理,如果本身就是 date 类型,去掉 to_date,不是保留。SELECT *
FROM T_SUPPLIER_ORDER A
WHERE A.SO_STATUS = 0
AND CEIL((SYSDATE -A.SO_ORDERTIME) * 24 * 60) >= '10'
;