0
Hello, I have the following problem: I need to display the localities, the number of shipments of each one (ie how often the name of the locality appears in the column) and the most common disease of each locality (that is, the name of the most common disease in that particular locality).
FOR EXAMPLE:
- locality: Croatian¡ 1
- Number of submissions: 4
- most common disease: Conjunctivitis
I have these two query’s but they don’t work together, just one or the other
SELECT localidade, count(localidade) AS qt FROM tb_grafico group by localidade;
SELECT localidade, tipo_doenca, COUNT(tipo_doenca) as qtidade FROM tb_grafico
where localidade='Croatá 1'
GROUP BY tipo_doenca
ORDER BY COUNT(tipo_doenca) DESC
LIMIT 1;
preferably in a single sql querry
What have you tried to do? Read tour site, the idea is to help solve more specific questions ;)
– rLinhares
yes I tried and got with two querry’s but when pulling the php data the first querry no longer worked
– KingBrDZN