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 / newbie

SELECT MAX(E.Salary) FROM
(SELECT MAX(Salary) SalaryFROM dep1
UNION
SELECT MAX(Salary) Salary FROM dep2) E

Is This Answer Correct ?    36 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about Joins?

1037


What is difference between group by and having?

995


explain different levels of normalization? : Sql server database administration

1050


What is wide table?

1015


What is analysis service repository?

1068


Explain datetime2 data type in sal server 2008?

952


What are the different types of join?

1240


Explain the functionalities that views support?

1162


What different steps will a sql server developer take to secure sql server?

1039


What it means to be triggered?

1082


How to receive returning result from a query?

1192


What do you know about normalization and de- normalization?

971


What type of locking occurs during the snapshot generation? : sql server replication

1376


How to identify current user in ssrs report?

408


What is triggers and its types?

1067