| Author: Neetu 05 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Try this statement.
select top 1 * from TABLE_NAME order by ID desc
regards Neetu
|
| Author: Nikhil Gaur 05 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
use this query
SELECT TOP 1 * FROM tablename
Join this campus group http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx
Thanks & Regards NIks My Software and Web Development Experience
|
| Author: Anuraj 05 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
Select the rows based on the inserted time, you may need to add a DATEFIELD in the db and set the DEFAULT as GETDATE().
ORDER BY Date DESC
Thanks Anuraj THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS. BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT. dotnetthoghts
|
| Author: atulpatel 05 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
There are couple of ways to do that thing.
1. You can use ID for Order By purpose. and using Top 1,you will get desired output.
2. You can use Time field for Order By the purpose. and using Top 1,you will get desired output.
Thanks, Atul
|