wat will be the sql query to extract only last 3 records
from table supose table hving thousands for records

Answer Posted / kumar

select top 3 * from tablename
order by 1 desc

By
Kumar Junior Software Engineer

Is This Answer Correct ?    13 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between primary keys and foreign keys?

503


How to get a list of columns using the "sys.columns" view in ms sql server?

549


How do I completely remove sql server instance?

553


Why would you call update statistics?

571


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

503






What is isolation levels?

558


How do you handle datasets larger than 50 gb?

140


How to connect Azure federated root database and apply federation in entity framework?

87


How to filter records of table in SQL SERVER?

587


Write the SQL query to drop, truncate and delete table.

542


What stored by the master?

535


What is failover clustering overview?

581


Write a SQL query to delete a table?

641


Explain the usage of floor function in sql server.

496


If a table does not have a unique index, can a cursor be opened on it?

510