sql - MySQL filtering out a criteria -


i thought simple guys here, little bit hard me figure out how this. have tried did not result wanted consult every 1 here.

here have 3 columns: state, store, laptop_brand wanted filter out how many store have amount of hp < 3 ( group state).

my idea on this:

select state, count(laptop_brand) sample_survey count(select store sample_survey laptop_brand = "hp") <3 group state

but not make real. sample_survey attached pic snippet data reference.

thank suggestions.

please try this:

select state, store, count(laptop_brand) total_laptop  sample_survey  laptop_brand = "hp"  group state, store  having count(laptop_brand)<3 

Comments

Popular posts from this blog

Lists in Python -

android - can not access to progress bar in an other activity -

html - Not able to access next element of an array javascript -