Hmmm, no. That's not it. The 2 queries using if() return the right
number of rows. The union return too few.
Anyway. I ended up with a query that runs in about 1 sec. compared to
the original that ran about 3 min. I'm happy :)
Thanks a bunch.
On Tue, December 9, 2008 14:53, Thomas Pundt wrote:
> On Dienstag, 9. Dezember 2008, Mogens Melander wrote:
> | I can't figure out why the "UNION" solution is missing 4 rows. I'll include
> | the 3 complete statements, so maybe someone smarter than me can figure out
> | why there's a difference in the result.
> Without having "studied" your query, my guess would be: double rows. UNION
> eliminates those; if you need them, use "UNION ALL". Just a guess though...
> Thomas Pundt <thomas.pundt@stripped> ---- http://rp-online.de/ ----
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.