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...

two tables are there.1st table EMP has two columns ID and name and contains data 1,A
2,B
3,C
2nd table EmpSal has 2 columns ID and Salary
Contains data -1,1000
2,5000
3,3000

Find name of employee having maximum salary ?

Answer Posted / b.kumar

--BY USING MS SQL SERVER

SELECT TOP 1 * FROM
(SELECT DISTINCT TOP 1 #A.ID,#A.NAME,#B.SAL
FROM #A INNER JOIN #B ON #A.ID=#B.ID ORDER BY SAL) E
ORDER BY SAL

--HERE #A, #B ARE TEMP TABLES
--E IS ALIAS NAME

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what is cte (common table expression)?

1066


How do I start sql server?

924


Explain cdc and sql injection?

912


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

893


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

1087


What is a trigger? Why we need it?

941


Can we shrink data file in sql server?

997


Do you know what are the steps to process a single select statement?

918


What is coalesce and check constraint in sql server?

1042


What the different types of Replication and why are they used?

978


what is the system function to get current user's user id? : Sql server database administration

949


What are different types of subquery?

1180


What is the use of group by clause?

900


How will you know when statistics on a table are obsolete?

1032


Explain what are various ways to enhance the ssrs report?

990