Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Where sql server user names and passwords are stored in sql server? : sql server database administration

1106


How extra digits are handled with numeric data type literals?

1034


Explain use of expression builder.

1071


Do you know what is blocking?

996


Name the different type of indexes in sql?

1012


How to run sql server 2005 books online on your local system?

1004


Different types of keys in SQL?

1146


What is DCL?

1104


How does recursive cte works in sql server?

1059


what are defaults? Is there a column to which a default can't be bound? : Sql server database administration

1183


What are the new features in SQL Server 2005 when compared to SQL Server 2000?

1214


How can you check the level of fragmentation on a table?

1087


How to find table changes in sql server?

1176


Explain the difference between clustered and non-clustered index?

971


What is user-defined scalar function?

1010