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 |
Is there an oracle sql query that aggregates multiple rows into one row?
Why do you create or replace procedures rather that drop and recreate.
How do I connect to oracle?
1. How actually index will work ? 2. Why do people prefer mostly bitmap index and btree index in datawarehouse ? 3. If I use the column in aggrigate functions like max,min,count and avg and if I have a index created on that column, will it increases the performance ?
What is the effect of setting the value 'FIRST_ROWS' for OPTIMIZER_GOAL parameter of the ALTER SESSION command ?
What is an oracle transaction?
Can we call a trigger inside a function and function inside a trigger? Give example.
18. Display the clientno and total value for all orders placed by that client. Output the result in the following format: Client <clientno> has placed orders to the value of <total value>
can u plz provide me oca sql dumps please i need them
How to rollback the current transaction in oracle?
What is a materialised view?
List the parts of a database trigger.