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 to get a list all databases on the sql server?

776


How do I create a stored procedure in sql server?

688


Why use “nolock” in sql server?

722


What is the maximum row of a size?

766


what is an index? : Sql server database administration

680






Does partitioning improve performance sql server?

645


How to find the source of a table in sql server?

709


How many types of subqueries are there in sql server?

657


Suppose we have a table "MyTable" containing 10 rows, what query should be executed to update the odd rows "Salary" as 9000?

751


How to create a local temporary stored procedure?

685


How do I find information about the install locations for the various instances running on a computer?

756


Explain in details security in SQL azure?

115


What is merge join?

808


Can you type more than one query in the query editor screen at the same time?

772


what is sql server? : Sql server database administration

696