sql - MySql : issue with GROUP BY and COUNT clauses -
i have table

i display products(with type) have @ least 2 different types.
here :

i have tried :
select product, type mytable group product, type having count(product) > 1; but doesn't give me result want.
the problem here want count different grouping want display. 1 way around 2 have counting in subquery:
select distinct product, type mytable product in (select product mytable group product having count(distinct type) > 1)
Comments
Post a Comment