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 do you understand by jdbc statements?
What are the higher level apis under development on top of jdbc currently?
What is resultsetmetadata?
Why do I get UnsatisfiedLinkError when I try to use my JDBC driver?
What is a statement in java?
How do we load the drivers?
What is “dirty read” in JDBC? Which isolation level prevents dirty read?
Is it possible to connect to multiple databases? Using single statement can we update or extract data from two or three or many databases?
Does JDBC support stored procedures?
What is difference between java.util.Date and java.sql.Date?
explain about special characters?
What is a java driver?
Is jdbc a web technology?
What is the role of the jdbc drivermanager class?
Describe odbc?