How to retrieve first and last records from a table?

Answers were Sorted based on User's Feedback



How to retrieve first and last records from a table?..

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

How to retrieve first and last records from a table?..

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

How to retrieve first and last records from a table?..

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

How to retrieve first and last records from a table?..

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

How to retrieve first and last records from a table?..

Answer / abc

SELECT * from empl WHERE ROWID IN (
SELECT MAX(ROWID) FROM empl
UNION
SELECT MIN(ROWID) FROM empl
);

Is This Answer Correct ?    0 Yes 0 No

How to retrieve first and last records from a table?..

Answer / reddy

select*from emp where rowid in (select min(rowid),max(rowid) from emp);

Is This Answer Correct ?    0 Yes 0 No

How to retrieve first and last records from a table?..

Answer / guest

select *from dual;

Is This Answer Correct ?    0 Yes 9 No

Post New Answer

More Oracle General Interview Questions

select statement does not retrieve any records. what exception is raised?

2 Answers  


Is java required for oracle client?

0 Answers  


find out first highest salary?

10 Answers   Verinon Technology Solutions,


Difference between open_form and call_form in oracle.

0 Answers  


I have two tables : COuntry,city I want all the cities in each country.Question on Cross Join.

3 Answers   Microsoft,






List out the types of joins.

0 Answers  


I know that i can create a table without a primary key.But is there any significance for that table???? while creating an application.

6 Answers  


What is user managed backup in Oracle?

0 Answers   MCN Solutions,


How do you increase the OS limitation for open files (LINUX and/or Solaris)?

0 Answers  


What happens to the indexes if a table is recovered?

0 Answers  


What is the purpose of init.ora. ? how many init.ora exist in oracle installation? suppose there are 3 database on one oracle server, how many init.ora do I have? what are various database objects? how will you identify memmory related performace issue in oralce? any idea about basic architure difference of oracle and db2? comment on which is better , with reasons? what is a fuction based index? is it recommended to use the same. ? what is global temporay table? what is teh signification of the parameter session_cached_cursor ?

1 Answers   HDFC,


Point the difference between translate and replace?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1789)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)