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 / kaka
create table #temp
(salary numeric(18,0)
)
insert into #temp
select max(salary) as salary from EmpSalary
union
select max(salary)as salary from EmpSalary1
select max(salary) from #temp
drop table #temp
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why variables called the most powerful component of ssis?
What are the different SQL Server Versions you have worked on?
What are the commands used in DCL?
What is the importance of concurrency control?
When we should use @@error?
Can binary strings be used in arithmetical operations?
how we use window authentication connection with sql server.?
What is the Difference Between Primary and Foreign Key?
Can you tell me about the concept of ER diagrams?
How to use the inserted and deleted pseudo tables?
can you instantiate a com object by using t-sql? : Sql server database administration
What do you mean by acid?
What is Lock table in SQL?
What happens if you delete a table that is used by a view?
How does stuff differ from the replace function?