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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-03-15 : 07:55:34
|
| Raymond writes "I'm using sql server 2000.i want to be able to retrieve the last row from a table. The table's ID is of type uniqueidentifier.Can anyone please help me with a query i can use. Thanks." |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-03-15 : 08:02:32
|
What is your definition of 'last row' ?Records are stored in table in no particular order. So there isn't a first row or last row.Or is this what you want ?select top 1 * from yourtable order by ID desc ----------------------------------'KH' |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2006-03-15 : 08:02:49
|
| select top 1 * from mytableorder by idcolumn desc |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|