write a query to select name from one table which has
id,name and salary from another table which has id, sal
where the salary is the second maximum
Answer Posted / bln
Select emp.name, emp.id, sal.salary from empDetai emp,
empSal sal
where emp.id=
(select innnerEmp.id from
(select innerEmpSal.id, innerEmpSal.sal from empSal
order innerEmpSal.salary desc
) where rowid=2;
)
And emp.id=sal.id;
This queiry initially execute the inner query and sort
records based on the salary. second inner query returns the
id of second maximum salary.
Is This Answer Correct ? | 4 Yes | 5 No |
Post New Answer View All Answers
What is resultsetmetadata?
How can we store the file in the oracle database?
Can I set up a connection pool with multiple user IDs? The single ID we are forced to use causes problems when debugging the DBMS.
If you are given a choice to implement the code to either insert a record or update if already exist, which approach will you follow ?
What is the most common example type 1 driver?
What is an encrypted internet connection?
How we store procedure in oralce for callable statements in jdbc
Are all the required JDBC drivers to establish connectivity to my database part of the JDK?
How many ways can you update a result set?
What is resultset?
How can you create jdbc statements?
Explain the necessary steps to connect to the database in java?
Which type of driver is unique in jdbc?
Explain jdbc savepoint?
What are clob and blob data types in jdbc?