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 |
Respected sir, Please send me technical questions related to oracle apps..
What is connection pooling in oracle?
I have a table like this Table Name:Products Productid Price 1 10 1 10 2 20 3 30 3 30 But i want to output like this. productid price 2 20. please replay me.
You have 4 instances running on the same UNIX box. How can you determine which shared memory and semaphores are associated with which instance?
What is a parameter file in oracle?
How to load data from external tables to regular tables?
Can we use bind variables in oracle stored procedure?
What is a package ? What are the advantages of package ?
If a table column has is UNIQUE and has NOT NULL, is it equivalent to a PRIMARY KEY column?
who is the father of oracle and send chodd rules
How to check the server version in oracle?
What different of iner joint & outer joint with example