|
Posted by Plamen Ratchev on 06/26/07 19:51
You can use a derived table, like this:
SELECT X.col1,
X.col2,
X.newcol1,
X.newcol2,
CASE WHEN X.newcol1 = X.newcol2
THEN 'Equal'
ELSE 'Not equal'
END AS compare
FROM (
SELECT col1,
col2,
<calculation1> AS newcol1,
<calculation2> AS newcol2
FROM Table1) AS X
INNER JOIN Table2
.....
HTH,
Plamen Ratchev
http://www.SQLStudio.com
Navigation:
[Reply to this message]
|