Hi Everyone,
How to get fist and last record from a table in oracle?
Thanks in advance
Answers were Sorted based on User's Feedback
Answer / cbigmudre
(select * from table limit 0,1)
union
(select * from table order by Id desc limit 0,1)
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / gourav
select * from employees
where employee_id=100
union
select* from employees
where employee_id=206;
Example
first coulumn_ id(100)
last column _id(206)
Is This Answer Correct ? | 0 Yes | 4 No |
Answer / ravi singh
select * from table_name
where rownum = 1
union
select * from table_name
where rownum > (select (count(1) - 1) from table_name);
I think this should work. try
Is This Answer Correct ? | 3 Yes | 18 No |
What are the types of optimization?
What is the difference between view and stored procedure?
what are numeric data types? : Sql dba
What is a sql*loader control file?
hi sql gurus, here is my question 4 u. i wanna use triggers for sending reminder mail to all users who are registered to the site. if any one knws the code plz send me ans here : chayabs3@gmail.com thnx advance
What is trigger and types?
explain advantages of myisam over innodb? : Sql dba
What is pl sql block in dbms?
What is basic structure of pl sql?
How to create a table using constraints... IF i change the PARENT KEY value ,then CHILD KEY table will also to change in the another table... plz reply ur answers @ mak2786@gmail.com Arunkumar
what is the syntax for using sql_variant_property? : Transact sql
What is keys and its types?