how to find out second largest value in the table
Answers were Sorted based on User's Feedback
Answer / irshad ahmad
Select max(price) from product where price
not in (select max(price) from product);
Is This Answer Correct ? | 15 Yes | 3 No |
Answer / sandeep
select * from (select ename,sal,rank() over(order by sal desc) as ranks from emp)
where ranks=2;
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / karthik
select distinct sal from emp a where 2 = (select count
(distinct sal) from emp b where a.sal <= b.sal)
Is This Answer Correct ? | 2 Yes | 1 No |
Answer / mk
select *from emp where sal=(select distinct(max(sal)) from
emp where sal <select max(sal) from emp )
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / sudhakara reddy k
select max(sal) from emp where
sal<(select max(sal) from emp);
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / kamala k n
select * from (select ename,sal,rank() over(order by sal desc) as ranks from emp)
where ranks=2;
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / vishal
select * from (
select * from test where sal < (select max(sal) from test)
order by 2 desc)
where rownum =1
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anandh
select * from emp where sal = (select max(sal) from emp where sal<>(select max(sal) from emp));
Is This Answer Correct ? | 0 Yes | 1 No |
How do you recover a datafile that has not been physically been backed up since its creation and has been deleted. Provide syntax example.
various types of joins
how to see the data (in unix) using dataset in datastage?
Why oracle is used?
what is reindexing?
Define the terms primary key foreign key and also the difference between primary and the unique key
Find all employees in Dept “Marketing”.
For a field in a repeating frame, can the source come from the column which does not exist in the data group which forms the base for the frame ?
How can I combine multiple rows into a comma-delimited list in oracle?
How to divide query output into groups in oracle?
How to create a new table in your schema?
Can you have more than one content canvas view attached with a window ?