Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 tSQL 获取两个日期列之间的差异并返回这两个日期之间的前 5 个最小差异?如果可能的话,我希望把它精确到分钟。
SELECT TOP 5 date1, date2, DATEDIFF(minute, date1, date2) FROM yourtable ORDER BY DATEDIFF(minute, date1, date2)