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

Answer Posted / teja

select * from employee where emp_id in
(select top 3 emp_id from employee order by emp_id DESC)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you make a trace?

573


How to rename an existing table with the "sp_rename" stored procedure in ms sql server?

532


difference between Clustered index and non clustered index ?

565


How many types of cursor type are there?

580


How to replace the Query Result 'Null Value' with a text ?

558






What are trace files?

522


role of sql sever 2005 in database rather than any other database

1504


When we should use @@error?

533


Explain what are various ways to enhance the ssrs report?

563


what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration

492


Explain go command in sql server?

536


What is an example of a foreign key?

501


How to rebuild all indexes on a single table?

576


What is standby servers? Explain types of standby servers.

503


Can sql server 2016 run on windows 7?

496