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 を使用して、2 つの日付列の差を取得し、これら 2 つの日付の差が小さい上位 5 つを返すにはどうすればよいですか? できれば分単位でお願いしたいです。
SELECT TOP 5 date1, date2, DATEDIFF(minute, date1, date2) FROM yourtable ORDER BY DATEDIFF(minute, date1, date2)