sql – 获取上一小时的记录

前端之家收集整理的这篇文章主要介绍了sql – 获取上一小时的记录前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有这个问题:
SELECT Field1,OrderFor,Writeback,Actshipdate,Orderstatus,receivedate,receivetime
FROM orderinfo,shippinginfo
WHERE orderinfo.orderid = shippinginfo.orderid
AND shippinginfo.custid = '37782'
AND receivedate =  DATE(NOW())
AND receivetime = ???????

我在任何地方使用Sybase自适应服务器并尝试获取最后一小时的记录.

解决方法

尝试这个 !!
SELECT Field1,receivetime
    FROM orderinfo,shippinginfo
    WHERE orderinfo.orderid = shippinginfo.orderid
    AND shippinginfo.custid = '37782'
    AND receivedate =  DATE(NOW())
     AND receivetime > DATEADD(HOUR,-1,GETDATE())
原文链接:https://www.f2er.com/mssql/84222.html

猜你在找的MsSQL相关文章