top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Oracle: how to display Odd/ Even number of records?

+3 votes
624 views
Oracle: how to display Odd/ Even number of records?
posted Mar 16, 2015 by Archana

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

To Display Even numbers of Rows:

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

To Display Odd number of Rows

Select * from emp where (rowid,1) in (select rowid,mod(rownum,2) from emp);

answer Mar 17, 2015 by Shivaranjini
...