As the title implies:
These 2 queries are returning different numbers. To me, they seem to basically be the exact same query. I looked at it for a good 20 mins yesterday and could not figured out why one would return more results than the other.
(the one with the inner join was returning slightly more rows)
-kaht
Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]
Code:
[COLOR=blue]select[/color] sum([COLOR=blue]t[/color].TOTAL) recordTotal
[COLOR=blue]from[/color] TRANSFERS..REPTRANSF [COLOR=blue]t[/color]
[COLOR=blue]inner[/color] [COLOR=blue]join[/color] TRANSFERS..REPHIERARCHY h
[COLOR=blue]on[/color] h.VP_ID = [COLOR=red]'ES3891'[/color]
and h.AGENT_UUID = [COLOR=blue]t[/color].AGENT_UUID
[COLOR=blue]where[/color] [COLOR=blue]t[/color].COL_DAT = [COLOR=red]'2008-03-01'[/color]
[COLOR=blue]select[/color] sum(TOTAL) recordTotal
[COLOR=blue]from[/color] TRANSFERS..REPTRANSF
[COLOR=blue]where[/color] COL_DAT = [COLOR=red]'2008-03-01'[/color]
and AGENT_UUID in (
[COLOR=blue]select[/color] AGENT_UUID
[COLOR=blue]from[/color] TRANSFERS..REPHIERARCHY
[COLOR=blue]where[/color] VP_ID = [COLOR=red]'ES3891'[/color]
)
These 2 queries are returning different numbers. To me, they seem to basically be the exact same query. I looked at it for a good 20 mins yesterday and could not figured out why one would return more results than the other.
(the one with the inner join was returning slightly more rows)
-kaht
Lisa, if you don't like your job you don't strike. You just go in every day and do it really half-assed. That's the American way. - Homer Simpson
[small]<P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <B> <P> <.</B>[/small]