how to get the maximum among two tables,for example table 1
(dep1) have (emp_id,emp_name,salary) columns and table 2
(dept2) have (emp_id,emp_name,salary) columns,i want which
employee have the maximum salary among two tables?
Answer Posted / newbie
SELECT MAX(E.Salary) FROM
(SELECT MAX(Salary) SalaryFROM dep1
UNION
SELECT MAX(Salary) Salary FROM dep2) E
| Is This Answer Correct ? | 36 Yes | 5 No |
Post New Answer View All Answers
Explain about Joins?
What is difference between group by and having?
explain different levels of normalization? : Sql server database administration
What is wide table?
What is analysis service repository?
Explain datetime2 data type in sal server 2008?
What are the different types of join?
Explain the functionalities that views support?
What different steps will a sql server developer take to secure sql server?
What it means to be triggered?
How to receive returning result from a query?
What do you know about normalization and de- normalization?
What type of locking occurs during the snapshot generation? : sql server replication
How to identify current user in ssrs report?
What is triggers and its types?