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
 Transact-SQL (2000)
 Last()

Author  Topic 

Billkamm
Posting Yak Master

124 Posts

Posted - 2006-02-08 : 10:02:04
In Microsoft Access there is a built-in function called Last(), which will return the last row for that particular field and return a single result.

Is there something similiar to this function or a way to duplicate this functionality in T-SQL?

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-02-08 : 10:03:08
There is no Last function in SQL Server. You can make use of Top and Order by

Select Top 1 * from yourTable order by keycolumn DESC

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -