Page 1 of 1

Advice for the correct syntax?

Posted: Wed Jul 11, 2012 8:37 pm
by jayson.ph
Hi all,

i any advice for the correct syntax for this. iknow you read it and understand it.

Code: Select all

("SELECT DISTINCT COUNT(item_name),cat_id,productid FROM tbl_itemdescription WHERE cat_id = '$cat' GROUP BY item_name HAVING COUNT(item_name) = '1' ORDER BY item_name "); 


Thanks

Re: Advice for the correct syntax?

Posted: Thu Jul 12, 2012 1:38 pm
by tr0gd0rr
I don't think you can have a DISTINCT COUNT(). If you are aggregating and grouping by, you should already get DISTINCT values