Re: Getting count() to include 0 counts in select - slow

2004-11-11 Thread SGreen
This will really speed things up: ALTER TABLE _ISO ADD KEY(_objective_id) If you do an EXPLAIN on your current query, you would see that no index is used for the _iso table so the engine has to do a table scan. And, for future reference, the output of SHOW CREATE TABLES is more informative tha

Re: Getting count() to include 0 counts in select

2004-11-10 Thread Mark Worsdall
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes It's a shorthand way to say that I wanted to group on the first two columns of my select statement. Here's a quote from the manual: http://dev.mysql.com/doc/mysql/en/SELECT.html Columns selected for output can be referred to in ORDER BY an

Re: Getting count() to include 0 counts in select

2004-11-10 Thread SGreen
.id, _objectives.name Make sense? Shawn Green Database Administrator Unimin Corporation - Spruce Pine Mark Worsdall <[EMAIL PROTECTED]> 11/10/2004 04:05 PM To [EMAIL PROTECTED] cc Subject Re: Getting count() to include 0 counts in select In message <[EMAIL PROTECTED]>,

Re: Getting count() to include 0 counts in select

2004-11-10 Thread Mark Worsdall
In message <[EMAIL PROTECTED]>, [EMAIL PROTECTED] writes Change one of your INNER JOINS to a LEFT JOIN. (The comma separated list of table names is actually a sneaky way to declare INNER JOINS). That way you will see all of the _objectives records whether or not they appear in _iso or any of the

Re: Getting count() to include 0 counts in select

2004-11-10 Thread SGreen
Change one of your INNER JOINS to a LEFT JOIN. (The comma separated list of table names is actually a sneaky way to declare INNER JOINS). That way you will see all of the _objectives records whether or not they appear in _iso or any of the other tables. SELECT_objectives.id, _objectives