0
I have two tables in Mysql
clientes
id
nome
cat
categorias
id
nome
I need to create a SELECT
, that shows all categories, but only categories that have more than 10 clients (for example).
I wanted it in just one SELECT
, but I can’t think what it would be like...
I tried that:
SELECT nome
FROM categorias
INNER JOIN clientes
ON clientes.cat = categorias.id
GROUP BY categorias.nome
HAVING COUNT(clientes.id) >=10
and already tried something? put in the query that has so far, if the problem is the 10 clients, show the query without this criterion
– Ricardo Pontual
I tried this>: SELECT name FROM categories INNER JOIN clients ON clients.cat = categories.id GROUP BY categories.name having Count (clients.id) >=10
– Luhhh