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

How to automatically create a log when an exception is being received into SQL Server?

1360


How to join two tables in a single query in ms sql server?

1059


What is resultset concur_updatable?

1054


What is a matrix in ssrs?

158


query processing

2221


What are the functions in sql server?

992


What are different types of collation sensitivity?

1025


What is global temp table?

1045


What is the full meaning of dml?

999


What is 3nf normalization form?

1169


If a table does not have a unique index, can a cursor be opened on it?

959


Do you know what are various aggregate functions that are available?

1216


What number sorts of privileges are accessible in sql?

1088


How can we remove orphan records from a table?

1030


Tell me what is normalization? Explain different forms of normalization?

1075