Re: strange query
| From: | pete M | Date: | Tue, 01 Jun 2004 15:18:11 +0000 |
| Subject: | Re: strange query | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-34615@lists.php.net to get a copy of this message | ||
doh !!!!!
thanks
Mikhail U. Petrov wrote:
Hi! You should use having c>2 instead of where c>2. Tuesday, June 1, 2004, 7:09:29 PM, pete wrote: pM> I'm running this query agains a mysql database, its a list of statuses pM> with a joined table that shows the number of job in that status with pM> more than 2. However I get the error pM> Unknown column 'c' in 'where clause' pM> select job_stats.job_stat_id, job_stat, job_stat_code, pM> count(works.job_stat_id) as c pM> from job_stats pM> inner join works on job_stats.job_stat_id = works.job_stat_id where c >> 2 pM> group by job_stats.job_stat_id, job_stat, job_stat_code pM> order by job_stats.job_stat_order asc pM> Any idead anyone please pM> tia pM> pedro