1
I have the following tables in Mysql (it is more complex than the example, I simplified):
CURSO: id | nome
CURTIDA: id | id_curso
Every time someone enjoys a course, feeds the table LIKES
Now, when I go to SELECT in the course, I would need to get the amount of likes, I did so:
SELECT *, count(curtida.id) AS curtidas FROM curso
LEFT JOIN curtida ON curtida.id_curso = curso.id
But I’m not getting the right number of likes... and if the course has not enjoyed, nor appearing is on this select.