I have an SQL database with one table: Product (maker, type, model)
For each row we have a different maker (brand), a type of product(pc, tablet, laptop, etc.) and a model (1.1 / 2.0 / 3.4.5 etc)
Q: How do I get the makers who produce only one product type and more than one model.
Output: maker, type.
Hints: GROUP BY and HAVING statements
I tried the following query, but it didn't work out, as it was not returning any value in the resulting table:
SELECT
maker, type
FROM
product
GROUP BY maker, type
HAVING count(model)>1 and count(type)=1
What am I doing wrong in this SELECT? Thank you very much!