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 |
|
pu_jan
Starting Member
2 Posts |
Posted - 2002-05-21 : 04:02:20
|
| how to get last record in Sql SErver thank u for help mebest regard pujan |
|
|
macka
Posting Yak Master
162 Posts |
Posted - 2002-05-21 : 04:23:36
|
| pujan,Try this:USE northwindSELECT TOP 1 * FROM OrdersORDER BY OrderID DESCmacka |
 |
|
|
JustinBigelow
SQL Gigolo
1157 Posts |
Posted - 2002-05-21 : 10:27:46
|
| pujan,Your question is relative. SQL Server does not store records in any particular order outside of the ordering constraints of a clustered index. Unless you specify the ordering of your data and therefore decide what you will designate as the last record. If you an ordering scheme to the table such as with an identity column then you will have a last record from an end user perspective but not from a SQL perspective.m2c,Justin |
 |
|
|
|
|
|