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
Where sql server user names and passwords are stored in sql server? : sql server database administration
How extra digits are handled with numeric data type literals?
Explain use of expression builder.
Do you know what is blocking?
Name the different type of indexes in sql?
How to run sql server 2005 books online on your local system?
Different types of keys in SQL?
What is DCL?
How does recursive cte works in sql server?
what are defaults? Is there a column to which a default can't be bound? : Sql server database administration
What are the new features in SQL Server 2005 when compared to SQL Server 2000?
How can you check the level of fragmentation on a table?
How to find table changes in sql server?
Explain the difference between clustered and non-clustered index?
What is user-defined scalar function?