0

我的桌子看起来像

ID      Name       TakenDateTime
2   critical care   19-Dec-12 11:04:45 AM
3   Pathology       26-Dec-12 5:59:28 PM
4   Radiology       05-Jan-13 7:20:56 PM
5   Cardiology      07-Jan-13 3:54:04 PM
6   Neurology       07-Jan-13 3:56:13 PM
7   Oncology        07-Jan-13 3:56:19 PM
9   Orthopedic      08-Jan-13 5:30:29 PM
10  Cardiothoracic  08-Jan-13 5:30:52 PM

从这张表我只是想要5th number of row data in SQL Server 2005。是否有可能,如果是,那么请为我提供可能的方法。任何帮助将不胜感激...

4

1 回答 1

5
SELECT
  ID,
  Name,
  TakenDateTime
FROM (SELECT
  ROW_NUMBER() OVER (ORDER BY Id) AS Row,
  *
FROM TableName)
t
WHERE t.Row = 5

Sql 小提琴演示

于 2013-08-06T07:05:47.893 回答