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

How can I determine where a given table is referenced via foreign keys?

1002


What are the advantages of using preparedstatement in java?

981


What does the jdbc driver interface do?

992


What are the components of jdbc?

985


Why do we use jdbc?

1009


How many locking systems are there in jdbc?

1024


How do I find whether a parameter exists in the request object?

913


What is connection data?

907


Which jdbc driver type s is are the jdbc odbc bridge?

878


Which is better jpa or jdbc?

909


What is statement and preparedstatement in java?

887


How to retrieve warnings in jdbc?

992


What is jdbc and explain jdbc architecture?

1016


The new features of the JDBC 2.0 API, will be supported for JDBC-ODBC Bridge?

2253


How can you use preparedstatement in jdbc?

996