[EMAIL PROTECTED] wrote:
I would think that the Jan solution should execute in a single pass
through the table. The Dave (subquery) version will probably need to make 3 passes through the table get the same results.
- er, it's Ian, not Jan :-)
As was mentioned in another response, the inequality comparisons
(=,<,>,etc.) are much faster than a LIKE comparison. So, I would also
suggest simplifying Jan's solution to read " IF(status='xxx',1,0)"
instead of "IF(concat(....) LIKE ...,1,0) ".
- I always concatenate the wanted criteria (status, in this case) with a
unique ID field in order to be absolutely certain I'm counting every
instance of each value of status. I've not investigated to see whether I
*really* need to do this, but it feels safer...
- ian
--
+-------------------------------------------------------------------+
| Ian Sales Database Administrator |
| |
| eBuyer http://www.ebuyer.com |
+-------------------------------------------------------------------+
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]