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
 Other Forums
 Other Topics
 excellent query

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-25 : 10:25:30
vinod writes "how to find second last row from the table.?"

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2006-08-25 : 11:05:31
think about using TOP and ORDER BY..



-ec
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2006-08-25 : 11:13:20
What's excellent in this

SELECT  TOP 1 * FROM TABLE WHERE ID < (SELECT MAX(ID) FROM TABLE ) ORDER BY ID DESC


Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page
   

- Advertisement -