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 does select 1 mean?
What is ssrs?
What is shared lock?
Explain what is public role in sql server?
Explain cdc and sql injection?
Explain full-text indexing?
What is db stored procedure?
Who developed sql server?
Do you know the cursor optimization tips?
Which data type columns are the best candidates for full-text indexing?
What is truncate table?
What is the definition for sql server 2000?
What are the lambda triggers?
What are the transaction properties?
How do I view a procedure in sql server?