帶你深入了解如何根據數據庫時間戳選擇列 數據庫開發
關鍵字:問題:我在工作中遇到了難題,一列數據,除了時間戳以外別的都一樣,誰能告訴我,應該如何來選擇?
解答:
--假如知道timestamp的值
select * from table where timestamp = 0x00000000000007EA
--不知道值
--第二列
select top 1 * from table where timestamp not in (select top 1 timestamp from table )
--第三列
select top 1 * from table where timestamp not in (select top 2 timestamp from table )
--第四列
select top 1 * from table where timestamp not in (select top 3 timestamp from table )
原文轉自:http://www.anti-gravitydesign.com