SELECT * FROM EMP WHERE ROWNUM <=(SELECT COUNT(1)/2 FROM EMP) MINUS SELECT * FROM EMP WHERE ROWNUM <=(SELECT COUNT(1)/2 FROM EMP)
Aug 11th, 2011
The following query works as follows: If the table has ten records, it will display the 5th and 6th record and if it has some 11 records, will display 6th record alone.
It will not work
SELECT * FROM EMP WHERE rownum=trunc(SELECT count(*)/2 FROM EMP)
Error at Command Line : 42 Column : 38
Error report -
SQL Error: ORA-00936: missing expression
00936. 00000 - "missing expression"
*Cause:
*Action:
Display Middle Record
Questions by shameem_chandu
Related Answered Questions
Related Open Questions