sql - MySql : issue with GROUP BY and COUNT clauses -


i have table

enter image description here

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

here :

enter image description 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

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -