Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 are the three parts of a jdbc url?

1027


If I use the JDBC API, do I have to use ODBC underneath?

1039


Explain the difference between rowset vs. Resultset in jdbc?

1008


How can we execute stored procedures?

1023


How can I get information about foreign keys used in a table?

972


Explain what should be done when a SQL exception is raised?

982


Can I get a null resultset?

1030


How can I get or redirect the log used by DriverManager and JDBC drivers?

940


What protocol does jdbc use?

984


Does the JDBC-ODBC Bridge support multiple concurrent open statements per connection?

1132


Does jdbc require oracle client?

937


Explain the process of creating tables using NetBeans IDE?

979


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

972


How can I create a custom RowSetMetaData object from scratch?

1009


What are different types of JDBC Drivers?

1173