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

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -