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


Please Help Members By Posting Answers For Below Questions

What do you understand by jdbc statements?

517


What are the higher level apis under development on top of jdbc currently?

494


What is resultsetmetadata?

506


Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?

570


What is a statement in java?

515






How do we load the drivers?

553


What is “dirty read” in JDBC? Which isolation level prevents dirty read?

599


Is it possible to connect to multiple databases? Using single statement can we update or extract data from two or three or many databases?

591


Does JDBC support stored procedures?

561


What is difference between java.util.Date and java.sql.Date?

542


explain about special characters?

544


What is a java driver?

504


Is jdbc a web technology?

496


What is the role of the jdbc drivermanager class?

489


Describe odbc?

558