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
How many types of keys are there?
It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio
What is report rendering ?
How does clustered and non clustered index work?
What is the use of keyword with encryption. Create a store procedure with encryption?
Define a cross join?
Explain transaction server consistency?
How can delete duplicate records in cte in sql server?
What does COMMIT command do?
What are the dis_advantages of stored procedures, triggers, indexes?
What is a fan-out query in SQL Azure?
How to make a column nullable?
Explain four layers of abstraction microsoft architectured?
what are the different types of SSRS reports?
Explain what are magic tables in sql server?