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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to get last row?

Author  Topic 

qingchengottawa
Starting Member

7 Posts

Posted - 2007-03-26 : 13:56:59
How to get the value of the last row in Microsoft SQL server?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-26 : 13:58:24
Which is your "last" row?
Per IDENTITY? Per DateAndTime? Per LastName?


Peter Larsson
Helsingborg, Sweden
Go to Top of Page

qingchengottawa
Starting Member

7 Posts

Posted - 2007-03-26 : 16:00:21
Per DateAndTime
Go to Top of Page

jezemine
Master Smack Fu Yak Hacker

2886 Posts

Posted - 2007-03-26 : 16:21:19
you need a datetime column for that. do you have one?


www.elsasoft.org
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-03-27 : 00:48:42
Try

select top 1 * from table1 order by dateandtimecolumn desc


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -