write the sql query to display 5th and 10th row in a table?

Answers were Sorted based on User's Feedback



write the sql query to display 5th and 10th row in a table?..

Answer / lakshmi reddy

select * from(select emp.*,rownum r from emp) where r=5 or r=10

Is This Answer Correct ?    8 Yes 1 No

write the sql query to display 5th and 10th row in a table?..

Answer / kart

select * from (select rownum as rn,aone.* from aone)
where rn in(5,10);

Is This Answer Correct ?    6 Yes 0 No

write the sql query to display 5th and 10th row in a table?..

Answer / gautam ramteke

select *
from(select rt.*,rownum r from (select * from gpr_employee
order by hire_date)rt)
where r in (5,8);

Is This Answer Correct ?    2 Yes 0 No

write the sql query to display 5th and 10th row in a table?..

Answer / gopal

By using rank or dense_rankl()

Is This Answer Correct ?    1 Yes 0 No

write the sql query to display 5th and 10th row in a table?..

Answer / harish

select * from emp where rownum<=&n;
if u give 5 insted of 'n' we get 5th record...

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Cognos Interview Questions

Does anybody have the sample of delivery document of cognos, or provide some link of websites Thanks

0 Answers  


what is the different between primarykey and surrogated key.. why we are going for surrogatekey...

1 Answers  


Can you please tell me the limitation of Excel file when exporting from report to Excel? I can export to HTML and PDF but I can't export to Excel. The report is more than 13000 rows. When exporting to Excel, system can view it. After that, I save the report to an Excel file. The size of Excel file is more than 11 MB. But I can't view this file by Excel. Please help me to solve this problem. Thanks!

1 Answers  


What is the difference btw reportnet - Report studio and cognos 8 - Report studio

3 Answers   Dominion,


1. What is stiched Query 2. What is loop in Fm 3. Best practices in modeling in FM 4. Three types of SQL 5. Difference between pass-thro and native sql? 6. will usage of pass thro sql will improve the performance? 7. Complex problems fced in your project 8. performance tuning in reports

1 Answers   CTS,






If you have a report with list and cross tab in the same page. How do you restrict one user can see only the list and the other user can see both.

4 Answers   IBM,


How many number of cubes can we create on a single model? How can we navigate between those cubes?

2 Answers  


What is the use of Cognos scenario?

0 Answers  


What junk dimension contains?

0 Answers  


Write a SQL query which should fetch the 5th maximum salary of an employee from the table?

14 Answers   HCL,


How to maintain Query subject’s relationships between Database layer and Model Layer? For eg - if 2 DB layer's query subjects are copied in Model Layer - Query subjects respectively, then Where should we define relationship of both Query subjects? Either in DB layer or Model layer?

0 Answers  


How to do deployment?

5 Answers  


Categories