Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2006-09-04 : 01:30:54
|
Hi experts,I'm in need to use the rowid of a column.is there any concept like rowid?for example, i need the first row of a table.or 5th row of a table.how can i write the query?thank you verymuch in advance. |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-09-04 : 01:35:15
|
To get row no 5use Northwindselect top 1 *from( select top 5 * from Customers order by CustomerID) dorder by CustomerID desc KH |
 |
|
sunsanvin
Master Smack Fu Yak Hacker
1274 Posts |
Posted - 2006-09-04 : 01:51:10
|
Thank you very much |
 |
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2006-09-04 : 02:08:37
|
SQL Server does not have a ROWID like Oracle does. or if it does, it is not exposed to TSQL in the same way that Oracle exposes ROWID to PLSQL. anyway, khtan's method will work, provided you have a unique or primary key in place that can be ordered (not a GUID for example). -ec |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2006-09-04 : 03:41:14
|
Not in SQL 2000, no. But in SQL 2005 it does.Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|