I'm using PHP and MySQL, I have two tables in the database:
POSTAGEM
id
----
1
3
13
CURTIDA
id | id_usuario | id_postagem
-----------------------------
1 | 1 | 1
7 | 12 | 1
What I can not do is the following: I want to give a select in the posts and next to it say how many tans each has, I did so:
SELECT postagem.id AS idPostagem, COUNT(curtida.id) AS curtidasTotais
FROM postagem
LEFT JOIN curtida ON curtida.id_postagem = postagem.id
GROUP BY curtida.id_postagem
But he does not list the posts that he has not tanned right ... in this example he does not list the post 13 (which has no tanned) but list 3 (which also has no tanned)
Here you can see this error in action: link