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

Answer Posted / pawan k. dubey

1-select * from employee where emp_id >(select count(*)-3
from employee)

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

)

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a sql query to sort on different column name according to the parameters passed in the function?

530


What are the advantages of using a stored procedure?

556


What is GUID in sql server?

637


What is RMS migrations?

1698


What is star, snowflake and star flake schema? : sql server analysis services, ssas

653






What is logon trigger?

546


What is 1nf 2nf and 3nf?

489


What is the data type of time?

513


What are examples of triggers?

610


What is partitioned view?

523


What is store procedure?

641


What is inner join in sql server joins?

541


What is the use of attributehierarchyvisible ? : sql server analysis services, ssas

571


How to add code to the existing article (using improve article)?

587


How global temporary tables are represented and its scope?

547