how to retrieve 1st and last row of table without using
group functions??
Answer Posted / prabhudatta
SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO) WHERE
ROWNUM=1
UNION
SELECT * FROM (SELECT * FROM EMP ORDER BY EMP_NO DESC)
WHERE ROWNUM=1;
| Is This Answer Correct ? | 14 Yes | 4 No |
Post New Answer View All Answers
How will you write a query to get a 5th rank student from a table student_report?
What privilege is needed for a user to delete rows from tables in another schema?
how to use select statement as formal parameter in procedure specification?(someone said that using string) ex:-procedure(a in number,select ename from emp ) i am asking syntax like this?
1) What is ONE_SIZE_FITS_ALL approach? 2) Explain the Common & Variable Header of DATA FILE? 3) What are the Drawbacks to using OMF DB? and the Advantages? 4) List out the Advantages of Undo T.spaces over the Undo SEGMENT? 5) Difference between the Temporary tablespace with TEMPFILE and the Tablespace with TEMPORARY Keyword? 6) What are the situation extents are freeing for reuse.
What is oracle rowcount?
Why do we use bulk collect in oracle?
 How to use an oracle sequence generator in a mapping?
What privilege is needed for a user to insert rows to tables in another schema?
How to turn on or off recycle bin for the instance?
What is blob datatype?
What do you mean by redo log file mirroring?
What do database buffers contain?
State the difference between a primary key and foreign key?
11. Display the client number and name and the client number and name of the person who referred that client.
Where is the export dump file located?