top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

How will you get 1 and 3rd and 5th records in table? What is the query in oracle?

+1 vote
44 views
How will you get 1 and 3rd and 5th records in table? What is the query in oracle?
posted Sep 4, 2015 by Amit Sharma

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

Select * from (select rownum as rn, emp.* from emp) where rn in (1,3,5);

answer Sep 7, 2015 by Manikandan J
Similar Questions
0 votes

I have an employee table with 20 records. The columns are employee name and salary. How can I get the details of employees with ranks between 5 and 10 on the basis of decreasing order of their salaries?

I am thinking of passing the table through a sorter to arrange the data in decreasing order of salaries, and then Sequence Generator Transformation giving unique id to the rows and finally a filter to select where the id is between 5 and 10. I realise this isn't an elegant solution? Is there a better way to do this? Thanks for your time

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...