1.how to extract the second highest salary from emp table
having sal as a column which contains the salary of all
employee of an organisation.
Answers were Sorted based on User's Feedback
Answer / ramya
select max(sal) from employees where
sal < (select max(sal) from employees)
| Is This Answer Correct ? | 21 Yes | 2 No |
Answer / neha k
select sal
from (SELECT sal, rownum row_num
FROM emp
order by sal desc)
where row_num = 2;
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / hema
Select sal from emp a where 2=(select count(distinct sal)
from emp b where a.sal <= b.sal)
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / esakkiraja
select a.* from(select dense_rank() over(order by sal)as
new_rank from emp) a where new_rank=2
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / swapna
select top(2) sal from emp where sal order by desc
| Is This Answer Correct ? | 0 Yes | 4 No |
Answer / swapna
select top(1) sal From sample
where sal
in (select top(2) salfrom sample order by saldesc)
order by sal asc
| Is This Answer Correct ? | 0 Yes | 7 No |
If I have a select statment which retrives 2 rows, & that rows have the same data in all the fields except the last field and I want to merge the 2 rows to be in 1 row with concatenating the last field which have the different data.... eg: the 1st row has these fields: A-B-C the second row has: A-B-X ........ i want to merge the two row to be in one row like ----> A- B- C,X
What is tablespace in oracle? how can we create? how is it manage? . . . Thnx 2 All in Advnc....:)
What is clusters ?
How to use like conditions in oracle?
I want a table like, no name address addr1 addr2 So i want columns like addr1,addr2 under address column. Can one please answer me. Advance Thanks.
How to do a full database export?
How to pass a parameter to a cursor in oracle?
What is redo log?
What is a system tablespace and when it is created?
What are the attributes that are found in a cursor?
How to run queries on external tables?
How can you tell how much space is left on a given file system and how much space each of the file systems subdirectories take-up?