How to display last 5 records in a table ?
With out Top key word and doing order by desc

Advance thanks

Answers were Sorted based on User's Feedback



How to display last 5 records in a table ? With out Top key word and doing order by desc Advance..

Answer / madhu


this is can acheieve by following query

select * from(select rowunum r,e.*from emp e) where
r>(select count(*)-5 from emp);

Is This Answer Correct ?    4 Yes 1 No

How to display last 5 records in a table ? With out Top key word and doing order by desc Advance..

Answer / priyank

select * from emp
minus
select * from emp where rownum <= (select max(rownum)-5
from emp)

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Informatica Interview Questions

What are the diffrences between joiner transformation and source qualifier transformation?

2 Answers  


After a load is done to my target table, I need to insert a last row, which might be formed at some expression transformation and brought to target. Do I have to have separate mapping to be run after the 1st mapping? Or in a single mapping how to achieve this?

3 Answers   TCS,


My sql query is 1. select 1+x from dual? 2. select 1+'x' from Dual? 3. Select x+1 from dual? what is the out put of the above queries?

3 Answers   HP,


Source as 1 1 2 2 3 3 How to get target as 1 2 3 and 1 2 3

3 Answers   CTS,


How to create a mapping ? id date 101 2/4/2008 101 4/4/2008 102 6/4/2008 102 4/4/2008 103 4/4/2008 104 8/4/2008 O/P - shud have only one id with the min(date) How to create a mapping for this

9 Answers   Deloitte,






what is sql override?what is the use of it?

4 Answers   Sonata,


What is Cognos script editor?

0 Answers   Cognizant,


How to enter same record twice in the target table,explain?

7 Answers  


How many input parameters can exist in an unconnected lookup?

0 Answers  


How did you handle performance issues If you have data coming in from multiple sources, just walk thru the process of loading it into the target

1 Answers  


tell me about your project functionality

0 Answers  


Hi experts, can anyone tell how much we use plsql in real time

3 Answers  


Categories