Re: PHP Mysql Select Distinct problem
| From: | Benjamin Walling | Date: | Wed, 22 May 2002 15:42:09 +0000 |
| Subject: | Re: PHP Mysql Select Distinct problem | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-19361@lists.php.net to get a copy of this message | ||
MessageAccording to http://www.mysql.com/doc/D/I/DISTINCT_optimisation.html,
DISTINCT is converted to a GROUP BY on all columns, DISTINCT combined with
ORDER BY will in many cases also need a temporary table.
Instead of using DISTINCT, consider adding GROUP BY for all the columns
except ID.