Display Odd/ Even number of records?
Answers were Sorted based on User's Feedback
Answer / nishi
Select rownum,empno,ename,salary from emp group by rownum,empno,ename,salary having Mod(rownum,2)=0 -- To display EVEN records.
Select rownum,empno,ename,salary from emp group by rownum,empno,ename,salary having Mod(rownum,2)=1 -- To display ODD records.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / swastik mohanty
--TO FIND EVEN NUMBER
SELECT * FROM Table
WHERE ROWID IN (SELECT DECODE(MOD(ROWNUM, 2), 0, ROWID, NULL) FROM Table);
--TO FIND ODD NUMBER
SELECT * FROM Table
WHERE ROWID IN (SELECT DECODE(MOD(ROWID, 2), 1, ROWID, NULL) FROM Table);
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / shareef
select * from emp where (rowid,0) in(select rowid,mod(rownum,2) from emp);---even
select * from emp where (rowid,1) in(select rowid,mod(rownum,2) from emp);---odd
| Is This Answer Correct ? | 2 Yes | 0 No |
List out the types of joins.
How do you bind variables in oracle?
What are the trigger associated with image items ?
ABOUT IDENTITY?
What is connection pooling in oracle?
How to assign values to data fields in record variables?
In which dictionary table or view would you look to determine at which time a snapshot or MVIEW last successfully refreshed?
What are ACID properties in databases?
Explain what are the characteristics of data files?
How to convert characters to numbers in oracle?
What privilege is needed for a user to create indexes in oracle?
Can you create a synonym without having a table?