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
Can we join two tables without primary key?
Is the log file is a part of file group?
what are user defined datatypes and when you should go for them? : Sql server database administration
Difference Between ORDER BY Clause and GROUP BY Clause in SQL?
What is a group function explain with an example?
What do you understand by check constraint in sql server?
Does partitioning help performance?
What is report subscription?
Can group by and orderby be used together?
What is trigger in salesforce?
How to connect sql server management studio express to sql server 2005 express?
What is implicit mode in sql server?
Does partitioning improve performance?
List down some advantages of sql stored procedure?
Describe triggers features and limitations?