Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / aswin

This query cost the performance :
delete from emp where empno in (select empno from (select
empno from emp order by rowid desc) where rownum <= 3)

Is This Answer Correct ?    9 Yes 0 No

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

Answer / 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

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

Answer / 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

More SQL PLSQL Interview Questions

What are the different types of functions in sql?

0 Answers  


what is the order of pre-defined exceptions.

6 Answers   TCS,


What are different joins used in sql?

0 Answers  


Explain character-manipulation functions?

0 Answers  


Why partition by is used in sql?

0 Answers  


using comand prompt how can import table data and table space with example

2 Answers  


How do I copy a table in sql?

0 Answers  


What are the advantages of the packages

6 Answers   Oracle,


Does truncate free space?

0 Answers  


List the ways to get the count of records in a table?

0 Answers  


What are the types of views in sql?

0 Answers  


What is record data type?

0 Answers  


Categories