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
How can I determine where a given table is referenced via foreign keys?
What are the advantages of using preparedstatement in java?
What does the jdbc driver interface do?
What are the components of jdbc?
Why do we use jdbc?
How many locking systems are there in jdbc?
How do I find whether a parameter exists in the request object?
What is connection data?
Which jdbc driver type s is are the jdbc odbc bridge?
Which is better jpa or jdbc?
What is statement and preparedstatement in java?
How to retrieve warnings in jdbc?
What is jdbc and explain jdbc architecture?
The new features of the JDBC 2.0 API, will be supported for JDBC-ODBC Bridge?
How can you use preparedstatement in jdbc?