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

Answers were Sorted based on User's Feedback



write a query to select name from one table which has id,name and salary from another table which ..

Answer / raveendra reddy

select emp.name,emp.id,sal.salary from empDetail emp,empSal
sal where sal.salary < (select max(salary) from empSal) and
emp.id=sal.id order by desc limit 1;

Is This Answer Correct ?    10 Yes 1 No

write a query to select name from one table which has id,name and salary from another table which ..

Answer / 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

write a query to select name from one table which has id,name and salary from another table which ..

Answer / 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

More JDBC Interview Questions

What is the use of JDBC DriverManager class?

0 Answers  


Which type of driver provides jdbc access via one or more odbc drivers?

0 Answers  


What does it mean to "materialize" data?

0 Answers  


What are types of jdbc drivers?

0 Answers  


What is hbm xml?

0 Answers  


How to set the attribute concurrency in resultset?

0 Answers  


What is while rs next ())?

0 Answers  


Explain the JDBC Architecture?

0 Answers  


What is jdbc odbc connection?

0 Answers  


How to handle when the database crashes while reading the data from the database?

2 Answers   IBM,


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

0 Answers  


Difference between servlet and applet method?

3 Answers  


Categories