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 / nagendra kumar m r

select top 1 e.[id],e.[name],s.salary from emp e join
emp_sal s on e.[id] = s.[id] and e.[id] in (select top 2
[id] from emp_sal order by salary desc)

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to set the attribute concurrency in resultset?

508


How many types of JDBC Drivers are present and what are they?

514


What is JDBC Statement?

575


What are different parts of a url?

516


Which database is used for java?

536






What are the steps to connect to a database in java?

484


How do I insert an image file (or other raw data) into a database?

534


Can we have foreign key reference to a non primary key column ?

537


What is database deadlock ? How can we avoid them?

527


What does executequery return in java?

522


How java can be connected to a database?

576


Why can't I invoke the ResultSet methods afterLast and beforeFirst when the method next works?

671


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

606


What is CLOB and BLOB datatypes in JDBC?

565


What is jdbc odbc connection?

517