How to retrieve first and last records from a table?
Answer Posted / naveen
SELECT * FROM EMP WHERE ROWID IN(SELECT MIN(ROWID) FROM EMP)
UNION ALL
SELECT * FROM EMP WHERE ROWID IN(SELECT MAX(ROWID) FROM EMP);
| Is This Answer Correct ? | 22 Yes | 0 No |
Post New Answer View All Answers
What is the exact use of Collections?
Why we use bulk collect in oracle?
What are the different types of record groups in oracle? Explain each of them
How do I limit the number of rows returned by an oracle query after ordering?
WHEN CURSOR MOVES FROM ONE FORM TO ANOTHER FORM, HOW MANY TRIGGER WILL BE FIRED AND WHAT ARE THEIR SEQUENCE?
What is a connect identifier?
What are the built-in functions used for sending Parameters to forms ?
In oracle there is column command, how will you explain that?
Can a parameter be passed to a cursor?
How to recover a dropped table in oracle?
What are transaction isolation levels supported by oracle?
> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?
How can we find out the current date and time in oracle?
What is partitioned table in Oracle?
What happens if recursive calls get out of control?