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

what is database replicaion? : Sql server database administration

1106


What is replication and database mirroring?

993


What is ssrs?

117


How do I connect to sql server database?

951


Explain about system stored procedure?

973


can SSRS reports Cache results?

136


What is a mixed extent?

955


What is the stuff?

950


Tell me what do you understand by a view? What does the with check option clause for a view do?

956


How would we use distinct statement? What is its use?

1024


What is partitioned view?

856


How do I find the default sql server instance?

906


what is the difference between count(*) and count(1) ?

1028


What is the server name in sql server?

959


What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?

964