The db in question is a shopping cart and I was looking for products I added
that might have been duplicated in another category. My first attempt that
worked.

select prodid,count(groupid) as cnt from products
  where (groupid=65 or groupid=66)
  group by imgsml order by cnt;

The thing wrong with this of course is that I wanted only the prodid's where
cnt>1. Eventually:

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?

As always thank you for any thoughts & pointers.

_____
Douglas Denault
[EMAIL PROTECTED]
Voice: 301-469-8766
  Fax: 301-469-0601

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to