Apr 16 2010 06:37 AM 13931 10 Fetch Alternate Rows priaa_7 How to fetch alternate rows from the table? Ram Feb 6th, 2013 CodeSELECT * FROM EMP WHERE (ROWID,1) IN (SELECT ROWID,MOD(ROWNUM,2) FROM EMP); OR SELECT * FROM (SELECT EMP.*,ROWNUM K FROM EMP) WHERE MOD(k,2)=0; Millar Jul 26th, 2012 CodeSELECT * FROM table_name WHERE mod(primary_key_column,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=1 --to find odd rows in a table Answer Question Select Best Answer
Apr 16 2010 06:37 AM 13931 10 Fetch Alternate Rows priaa_7 How to fetch alternate rows from the table? Ram Feb 6th, 2013 CodeSELECT * FROM EMP WHERE (ROWID,1) IN (SELECT ROWID,MOD(ROWNUM,2) FROM EMP); OR SELECT * FROM (SELECT EMP.*,ROWNUM K FROM EMP) WHERE MOD(k,2)=0; Millar Jul 26th, 2012 CodeSELECT * FROM table_name WHERE mod(primary_key_column,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=1 --to find odd rows in a table Answer Question Select Best Answer
Ram Feb 6th, 2013 CodeSELECT * FROM EMP WHERE (ROWID,1) IN (SELECT ROWID,MOD(ROWNUM,2) FROM EMP); OR SELECT * FROM (SELECT EMP.*,ROWNUM K FROM EMP) WHERE MOD(k,2)=0;
Millar Jul 26th, 2012 CodeSELECT * FROM table_name WHERE mod(primary_key_column,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=0 --to find even rows in a table SELECT * FROM employees WHERE mod(employee_id,2)=1 --to find odd rows in a table