how will you find out the last three records in a table
with n no of records and delete them

Answer Posted / ajit

delete from emp
where empno in
(select empno
from emp
minus
select empno
from emp
where rownum <= ( select count(*) - 3
from emp
))

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What programs use sql?

530


what are the differences among rownum, rank and dense_rank? : Sql dba

543


Can we call a function containing dml statements in a select query?

548


What is pl sql and why it is used for?

577


What is dbo in sql?

538






Explain the update statement in sql

565


What is varray in pl sql?

568


Can you have more than one key in a database?

512


what is the stuff function and how does it differ from the replace function? : Sql dba

624


What are the uses of merge?

726


How to make a copy values from one column to another in sql?

582


What is dba in sql? : SQL DBA

539


What is int identity in sql?

576


What is the benefit of foreign key?

531


What is dcl in sql?

528