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

Answer Posted / sudipta santra

delete from
(select * from tab1
minus
select * from tab1 where rownum<n-2 order by rowid)

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a constraint? : Sql dba

882


Can you load data into multiple tables at once? : aql loader

800


What is the purpose of the sql select top clause?

736


Which join condition can be specified using on clause?

702


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3309






What are pl sql procedures?

699


How do I create a memory optimized filegroup?

697


What is trigger price?

731


What is using in sql?

794


Can we rename a column in the output of sql query?

727


What are the different sql commands?

724


Can two tables have same primary key?

729


how to fetch alternate records from a table? : Sql dba

825


Which software is used for pl sql programming?

677


Is a secondary key the same as a foreign key?

673