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
How to automatically create a log when an exception is being received into SQL Server?
How to join two tables in a single query in ms sql server?
What is resultset concur_updatable?
What is a matrix in ssrs?
query processing
What are the functions in sql server?
What are different types of collation sensitivity?
What is global temp table?
What is the full meaning of dml?
What is 3nf normalization form?
If a table does not have a unique index, can a cursor be opened on it?
Do you know what are various aggregate functions that are available?
What number sorts of privileges are accessible in sql?
How can we remove orphan records from a table?
Tell me what is normalization? Explain different forms of normalization?