Can someone tell me why:

SELECT Items.*, IF(Items.status IN ('Event', 'Not Purchasable',
      Special') OR ('0000-6-12' >= Items.start AND '0000-6-12'
      Items.end),1,0) as inseason FROM Items, Categories WHERE
      Items.category=Categories.id AND Items.showitem>0 AND
      Categories.id > 5 AND IF(Items.status='Use Inventory',
      Items.invqty>=Items.invminqty,1) ORDER BY Items.created desc LIMIT 0,1

Results in a table overflow, and:

SELECT Items.*, IF(Items.status IN ('Event', 'Not Purchasable',
      Special') OR ('0000-6-12' >= Items.start AND '0000-6-12'
      Items.end),1,0) as inseason FROM Items LEFT JOIN Categories ON
      Items.category=Categories.id AND Items.showitem>0 AND
      Categories.id > 5 WHERE IF(Items.status='Use Inventory',
      Items.invqty>=Items.invminqty,1) ORDER BY Items.created desc LIMIT 0,1

Does not?

I don't want to use a left join in this statement.  I WANT the extra
restriction provided by a right join, which I *thought* would also make the
resultant temporary table (I'm using Perl DBI) smaller, not larger

Thanks,

Chris


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to