how will u get 1 and 3rd and 5th records in table what is
the query in oracle please help me

Answers were Sorted based on User's Feedback



how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / kondeti srinivas

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

Is This Answer Correct ?    22 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / suresh

TO DISPLAY THE EVEN NUMBERS
SELECT ROWNUM,EMPNO,ENAME,SAL FROM EMP
GROUP BY ROWNUM,EMPNO,ENAME,SAL
HAVING MOD(ROWNUM,2)=0;


TO DISPLAY THE ODD NUMBER IS TO REPLACE ONLY MOD(ROWNUM,2)!=0

Is This Answer Correct ?    9 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / siva reddy

display odd records
select * from emp where (rowid,1) in ( select
rowid,mod(rownum,2) from emp)

display even records

select * from emp where (rowid,0) in ( select
rowid,mod(rownum,2) from emp)

Is This Answer Correct ?    10 Yes 5 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / amedela chandra sekhar

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

Is This Answer Correct ?    6 Yes 2 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / amedela chandra sekhar

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

Is This Answer Correct ?    4 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / gyana

SELECT RN,EMPNO,ENAME,SAL FROM
(SELECT ROWNUM RN,EMPNO,ENAME,SAL FROM EMP)
WHERE RN IN (1,3,5)

---------------------------------------------------
I ALREADY TESTED ITS WORKING..PLS ANY CORRECTION LET ME KNOW

Is This Answer Correct ?    3 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / sp hari

select * from emp where rowid=(select
decode(mod(rownum,2),0,null,rowid) from emp)

Is This Answer Correct ?    4 Yes 1 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / kondeti srinivas

select * from emp where (rowid,1) in (select rowid,mod(rownum,2) from emp where rownum<=5)

Is This Answer Correct ?    1 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / anjan

select rownum,empno,ename,sal from (select
rownum,empno,ename,sal from emp)
group by rownum,empno,ename,sal
having rownum in (1,3,5)

Is This Answer Correct ?    1 Yes 0 No

how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me..

Answer / uma

select * from (select rownum rn,ename,job,sal
from emp)
where mod(rn,2) <> 0;

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Informatica Interview Questions

What are limitations of joiner transformation?

2 Answers   Exilant, TCS,


Why you use repository connectivity?

3 Answers   Yash Technologies,


In a sequential batch can you run the session if previous session fails?

4 Answers  


need for registering a repository server

1 Answers  


I want skip first 5 rows to load in to target? what will be the logic at session level ??

1 Answers   IBM,






in flatfile target how can u create header and footer plese give me the comands how will u write in session properties

3 Answers   Patni,


Why the UNION TRANSFERMATION is an Active TRANSFERMATION

6 Answers   Emphasis,


why do we go for update strategy tr in SCD rather using the session properties?

3 Answers   IBM,


Update strategy transformation is an active transformation.How it changes the number of records that pass through it? Please explain....

2 Answers  


If you want to create indexes after the load process which transformation you choose?

3 Answers   HCL,


explain different levels in pushdown optimization with example?

2 Answers   TCS,


How to Explain My project flow,In TCS ased me this question. In which way i can start my project flow and they asked how many fact tables and dimensional tables u used. Can any one Explain Briefly for this question and project architecture also.. please..

3 Answers   CTS, HCL, Infosys, TCS,


Categories