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

Answer Posted / vijaykumar dolli

Select * From Sample Where
Srno In (Select Top 3 srno From Sample Order By 1 Desc)

-- Sample is a Table Name and Srno is Unique Key column
-- This is the perfect Answer ...!

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the main purpose of having conversation group?

487


How to convert numeric expression data types using the cast() function?

538


What is mssql?

562


What do you understand by recursive stored procedures?

561


what is a default tcp/ip socket assigned for sql server? : Sql server database administration

526






Explain tables in SQL Azure?

94


Give me any three differences between Truncate and Delete.

559


Why normalization is used?

544


What are the security related catalog views? : sql server security

526


What is the syntax to execute the sys.dm_db_missing_index_details?

576


Tell me the difference between clustered and non-clustered index?

503


What are the main sources of data?

584


How to skip remaining statements in a loop block using continue statements?

535


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

671


How many joins in sql server?

508