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...


Write a query to get last 10 records from the table.

Answers were Sorted based on User's Feedback



Write a query to get last 10 records from the table...

Answer / jprakash025

select * from emp
minus
select * from emp
where
rownum<=(select count(*)-10 from emp);

or



SQL> select * from
2 (select rownum a, emp.* from emp)
3 where
4 a>(select max(rownum)-10 from emp);

Is This Answer Correct ?    24 Yes 2 No

Write a query to get last 10 records from the table...

Answer / l meher

select * from emp minus select * from emp where rownum<=
(select count(*)-10 from emp);

Is This Answer Correct ?    8 Yes 3 No

Write a query to get last 10 records from the table...

Answer / praveen biradar

select empno from (select empno from emp order by empno
desc) where rownum<=10 order by empno

Is This Answer Correct ?    10 Yes 6 No

Write a query to get last 10 records from the table...

Answer / pallavi v

with temp as
(select * from emp order by rownum desc)
select * from temp where rownum < = 10

Is This Answer Correct ?    0 Yes 0 No

Write a query to get last 10 records from the table...

Answer / siddharthapenchala

select * from <TN>
minus
select * from <TN>
where
rownum <= (select count(*) - &n from <TN>)

Is This Answer Correct ?    0 Yes 0 No

Write a query to get last 10 records from the table...

Answer / nzabin

select PO_header_id from (select PO_header_id from PO_HEADERS_ALL order by PO_header_id
desc) where rownum <=10 order by PO_header_id;

Is This Answer Correct ?    0 Yes 0 No

Write a query to get last 10 records from the table...

Answer / sudhir

select rownum, p.*
from (select * from <table name> order by param_cd desc) p
where rownum <= 10 ;

Is This Answer Correct ?    1 Yes 2 No

Write a query to get last 10 records from the table...

Answer / akshaya

select * from last10
minus
select * from last10
where row >= (select COUNT(*)-10 from last10)


condition should be >= not <=
for all the above queries

Is This Answer Correct ?    0 Yes 1 No

Write a query to get last 10 records from the table...

Answer / swastik

SELECT ROWNUM, E1.*
FROM
(
SELECT * FROM Emp
ORDER BY ROWNUM DESC
)E1
WHERE ROWNUM <= 10

Is This Answer Correct ?    0 Yes 1 No

Write a query to get last 10 records from the table...

Answer / chandrakishan

select * from emp where rownum>=
(select count(*)-10 from emp);

Is This Answer Correct ?    1 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is nvl function?

4 Answers   Cap Gemini,


What are the datatypes available in pl/sql ?

0 Answers  


What are views in sql?

0 Answers  


How would you pass hints to the sql processor?

0 Answers  


The select into statement is most often used to create backup copies of tables or for archiving records?

0 Answers  


Explain the difference between triggers and constraints?

0 Answers  


how to retrieve the top 2 salaried persons from a database?

7 Answers   Orion Laboratories,


What is java sql driver?

0 Answers  


What is mdf ldf and ndf?

0 Answers  


How toimport .dmp file in lower version of oracle from higher version ?

4 Answers   TCS,


how can we find the number of rows in a table using mysql? : Sql dba

0 Answers  


what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba

0 Answers  


Categories