On Tue, Jan 13, 2004 at 02:03:26AM -0500, [EMAIL PROTECTED] wrote: > > select prodid,count(groupid) as cnt from products > where (groupid=65 or groupid=66) > group by imgsml having cnt>1; > > I.e. replacing order by with a having clause. After trying many variations; are > 'order by' and 'having' mutually exclusive? If so - how would you order the > result table?
They shouldn't be, you just need to get the order right: select prodid,count(groupid) as cnt from products where (groupid=65 or groupid=66) group by imgsml having cnt>1 order by cnt; Is perfectly valid syntax. -- Chris -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]