How to retrieve first and last records from a table?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / girija.112
select *
from employees
where rowid = (select max(rowid)
from employees)
or rowid =(select min(rowid)
from employees)
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / avnish srivastava-test engg fc
select* from employees where rowid=(select min(rowid) from
employees)
union
select* from employees where rowid=(select max(rowid) from
employees)
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ganesh
hi Avnish Srivastava-test Engg Fc
plssssssss can u send the data base testing material
my mail id.... gan9000@gmail.com
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / reddy
select*from emp where rowid in (select min(rowid),max(rowid) from emp);
Is This Answer Correct ? | 0 Yes | 0 No |
What are the different type of Segments ?
Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?
What are the attributes of the cursor?
How to create a new table in your schema?
What is a lookup table in oracle?
How to pass parameters to procedures in oracle?
According to oracle specification VIEW is a object. OBJECT that means anything stored in the oracle database that has the physical existence.why VIEW doesn't take memory in oracle database, but it is treated as a object ?Please explain ?
What is the order of defining local variables and sub procedures/functions?
i can't insert column value greater than 4000 characters at one instance even i am using CLOB datatype . how to insert efficiently more than 4000 characters ? And please let me know how to impose inline and out-of line constraints on oracle column??? Thanks in Advance... Prakash
what is the uses of cusor
What are the general rules on data consistency?
Why do we need oracle client?