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
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
write a query following source region sales 1 1000 2 2000 i want the output ?please give solution 1 2 1000 2000
What are pre and post-session shell commands?
Which development components of informatica have the highest usage?
What are the connected or unconnected transforamations?
Explain the tuning lookup transformation - informatica
I want skip first 5 rows to load in to target? what will be the logic at session level ??
select count(1) from emp? what is the o/p?
My Source qualifier has empno, sal. Now my mapping is like SQ(EMPNO)->AGGR->EXP->TARGET SAL ------------>TARGET ? means only one source qualifier has 2 columns like empno, sal. connected to same target as shown in above mapping.Is this mapping valid or any issues are there if we design like this?
hOW CAN WE DELETE A RECORD OR TRUNCATE IN TARGET TABLE USING SQL T/R ?
What is incremental aggregation and how it is done?
8 Answers JPMorgan Chase, TCS,
what is difference between mapping and mapplet ?
How do you load only null records into target?