查询日期最大值:
SELECT *
FROM PERSON P
WHERE P.LAST_UPDATED_DATETIME =
(SELECT MAX(P.LAST_UPDATED_DATETIME) FROM PERSON P)
查询离日期最大值1小时之间的数据:
SELECT *
FROM PERSON P
WHERE P.LAST_UPDATED_DATETIME <= (SELECT MAX(P.LAST_UPDATED_DATETIME)
and P.LAST_UPDATED_DATETIME >= ((SELECT MAX(P.LAST_UPDATED_DATETIME)-1/24)
FROM PERSON P)
阅读(4422) | 评论(0) | 转发(0) |