服务热线:13616026886

技术文档 欢迎使用技术文档,我们为你提供从新手到专业开发者的所有资源,你也可以通过它日益精进

位置:首页 > 技术文档 > 数据库技术 > Oracle技术 > Oracle开发 > 查看文档

带你深入了解如何根据数据库时间戳选择列

【赛迪网-it技术报道】问题:我在工作中遇到了难题,一列数据,除了时间戳以外别的都一样,谁能告诉我,应该如何来选择?

解答:

--假如知道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 )

扫描关注微信公众号