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

Answer Posted / amit kaishver

Select * from ( select rownum k,g.* from nbfc_bank_m g) h,
(select max(rownum) a,max(rownum)-1 b,max(rownum)-2 c
from nbfc_bank_m ) p
where h.k in (p.a,p.b,p.c)

Is This Answer Correct ?    5 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we need different type of parameter?

550


What is the use of builtinadministrators group in sql server? : sql server security

537


Why truncate is ddl?

613


What is 5nf in normalization form?

576


Can you explain powershell included in sql server 2008?

508






What is the data type of time?

521


Tell me about builtinadministrator?

564


Can we use max in where clause?

519


you have separate development and production systems you want to move a copy of a development database into production to do this, you do a backup on the development system and restore to the production system after a few minutes, you begin getting calls from several customers saying that they are denied access to the system why? : Sql server administration

553


Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?

528


What is query optimizer in sql server?

553


What does indexation mean?

533


Define primary key?

661


How to loop through the result set with @@fetch_status?

671


What is field in algebra?

630