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
what is database replicaion? : Sql server database administration
What is replication and database mirroring?
What is ssrs?
How do I connect to sql server database?
Explain about system stored procedure?
can SSRS reports Cache results?
What is a mixed extent?
What is the stuff?
Tell me what do you understand by a view? What does the with check option clause for a view do?
How would we use distinct statement? What is its use?
What is partitioned view?
How do I find the default sql server instance?
what is the difference between count(*) and count(1) ?
What is the server name in sql server?
What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?