Thursday, March 13, 2008

Find top salary among two tables

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

1 comment:

R.B. Prajapati said...

thanks boss for experience user.
but as fresher not better, if u include fully practically like give me table then impliment so it more better.

Ram Prajapati

rb.prajapati83@gmail.com