Re: strange query

From: Date: Tue, 01 Jun 2004 15:18:01 +0000
Subject: Re: strange query
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34616@lists.php.net to get a copy of this message
From: "pete M" <pmorgan@ukds.net> > I'm running this query agains a mysql database, its a list of statuses > with a joined table that shows the number of job in that status with > more than 2. However I get the error > > Unknown column 'c' in 'where clause' > > select job_stats.job_stat_id, job_stat, job_stat_code, > count(works.job_stat_id) as c > from job_stats > inner join works on job_stats.job_stat_id = works.job_stat_id > where c > 2 > group by job_stats.job_stat_id, job_stat, job_stat_code > order by job_stats.job_stat_order asc > > Any idead anyone please Try "having c > 2" instead of "where c > 2" ---John Holmes...

« previous php.db (#34616) next »