What is the output of the query,
select * from Person where rowid in (select decode(mod(rownum,2),0,rowid, null) from Person)

 Posted by Kmandapalli on 1/22/2014 | Category: Oracle Interview questions | Views: 783 | Points: 40
Answer:

Whenever you want to select alternate records with even numbers then you need to execute the following query,

select * from Person where rowid in (select decode(mod(rownum,2),0,rowid, null) from Person)

The output will be the even number records from your databse like 2, 4, 6 and so on


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response