Chinaunix首页 | 论坛 | 博客
  • 博客访问: 92433631
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: Oracle

2008-04-22 12:36:39

    来源:赛迪网    作者:钱宁

问题:我在工作中遇到了难题,一列数据,除了时间戳以外别的都一样,谁能告诉我,应该如何来选择?

解答:

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

阅读(512) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~