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 we store the file in the oracle database?
What is device controller?
How do we load the drivers?
Explain the importance of drivermanager.
What is jdbc in dbms?
Does the JDBC-ODBC Bridge work with Microsoft J++?
What does it mean to "materialize" data?
What are the types of statements in jdbc?
What are the differences between setmaxrows(int) and setfetchsize(int)?
Under what circumstances, that all four drivers are used?
How many types of jdbc drivers are there?
Does JDBC support stored procedures?
What are the basic exceptions in jdbc?
What is jdbc driver manager?
Where is jdbc url mysql?