SELECT TOP 1 sal FROM
(SELECT MAX(sal) AS sal FROM sal1 UNION SELECT MAX(sal) AS sal FROM sal2) a
ORDER BY sal DESC
It's ok but i want top 5 salary from two tables at a time. like in this given query we find max salary from two sal.
It's ok but i want top 5 salary from two tables at a time. like in this given query we find max salary from two sal.
ReplyDelete