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

Answer Posted / balaji

select * from table_name ORDERBY id DESC limit 0,n;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you explain important index characteristics?

690


How can you transfer data from a text file to a database table? Or how can you export data from a table to a comma delimited (csv) file? Or how can you import data from ms access to a table in a database? Or how can you export data from a table to an excel file?

766


Why we need sql server?

715


Explain raiserror in sql server?

753


What is a result set object returned by odbc_exec()?

725






what are the different types of SSRS reports?

122


How can we rewrite sub-queries into simple select statements or with joins?

708


What happens when converting big values to integers?

729


What are different types of replication in sql server?

745


What happens if date-only values are provided as date and time literals?

750


What are the different types of backups that exist?

849


What are the different types of sql server replication? : sql server replication

804


whats new about truncate in sql server 2008?

2225


How can you append an identity column to a temporary table?

623


What is the command to change the recovery model?

762