-2
As the image shows, I have the table adms_unidade
where I can already show the units listed, and I have the table adms_equipamentos
with various registered equipment.
I want to show how many registered equipment I have in each unit using the adms_unidade_id
which is the foreign key to tablea adms_equipamentos
key-related primary
table adms_unidades
.
I’ve seen some examples and ways, but I don’t know if it’s typo or not.
Make an INNER JOIN of the tables and use the COUNT aggregation function with the GROUP BY clause. Posting images in place of codes is not an attitude well seen on this site, the same not to post the code of the query you tried with the explanation of why you consider the wrong result.
– anonimo