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
how many no of arguments can be passed in procedures and functions
Can we install sql server 2016 on windows 7?
What is report snapshot?
Call by value and call by reference in procedure and function, with NOCOPY.
If no size is defined while creating the database, what size will the database have?
Do you know what is blocking?
Define inner join? Explain with an example?
What is the difference between ddl and dml?
Explain different types of collation sensitivity?
Define inner join in sql server joins?
Where actually sql azure database is hosted?
Can a stored procedure call itself or recursive stored procedure? How many levels sp nesting is possible?
Explain the purpose of indexes?
Can you explain various data region available in ssrs with their use?
How do indexes help, types?