Display Odd/ Even number of records?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is open database communication (odbc) in oracle?

544


How to pass a cursor variable to a procedure?

554


what is port in oracle? how is it related to database application.

1435


How do you increase the OS limitation for open files (LINUX and/or Solaris)?

1462


What is integrity and what is constraint??Explain with example

1695






How to count groups returned with the group by clause in oracle?

572


Can we use bind variables in oracle stored procedure?

488


How to filter out duplications in the returning rows using oracle?

635


What do you mean by group by clause?

555


Which is better Oracle or MS SQL? Why?

3967


Is oracle an open source?

632


Explain database link?

660


Explain what does a control file contain?

607


How data locks are respected in oracle?

570


Why is oracle used?

551