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 does setautocommit do?
Can resultset be null in java?
Which is faster jdbc or odbc?
What is jdbc and explain jdbc architecture?
What is represented by the connection object?
Which constraint cannot be specified as an explicit constraint and should be specified with the column only ?
What is the difference between jdbc and jndi?
Is jdbc part of j2ee?
How do we call a stored procedure from jdbc?
What are the different types of JDBC drivers?
How we store procedure in oralce for callable statements in jdbc
What is DML?
What is jdbc oracle thin?
Describe the steps needed to execute a sql query using jdbc.
What is sqlwarning and discuss the procedure of retrieving warnings?