Subject | SQL help please |
---|---|
Author | Gary Benade |
Post date | 2005-02-24T07:02:27Z |
Will the following two queries give the same results? Is there a beneifit to
doing it either way?
SELECT SUM(Y.TOTAL) FROM TABLEONE X
LEFT OUTER JOIN TABLETWO Y ON X.LINK = Y.LINK AND Y.DELETED = 'N'
WHERE X.LINK = 1
SELECT SUM(Y.TOTAL) FROM TABLEONE X
LEFT OUTER JOIN TABLETWO Y ON X.LINK = Y.LINK
WHERE X.LINK = 1 AND Y.DELETED = 'N'
TIA
Gary
doing it either way?
SELECT SUM(Y.TOTAL) FROM TABLEONE X
LEFT OUTER JOIN TABLETWO Y ON X.LINK = Y.LINK AND Y.DELETED = 'N'
WHERE X.LINK = 1
SELECT SUM(Y.TOTAL) FROM TABLEONE X
LEFT OUTER JOIN TABLETWO Y ON X.LINK = Y.LINK
WHERE X.LINK = 1 AND Y.DELETED = 'N'
TIA
Gary