Monday, 27 June 2011

how to find the alternative rows in sql

SELECT *
FROM   emp
WHERE  (ROWID,0) IN (SELECT ROWID, MOD(ROWNUM,2)
                     FROM   emp);



SELECT *
FROM   emp
WHERE  (ROWID,0) NOT  IN (SELECT ROWID, MOD(ROWNUM,2)
                     FROM   emp);

No comments:

Post a Comment