I have to get all the posts even if they have 0 likes on the count, but those aren't showing up no matter what, I tried inner join, left outer join and nothing
select
post.id as idPost,
post.data,
autor.nome as nome,
post.texto,
post.idAutor,
count(likes.idAutor) as numeroLikes
from post
join utilizador autor
on autor.id = post.idAutor
left join likes
on post.id = likes.idPost
left join amigos as a
on a.idAmigo2 = post.idAutor
where (post.idAutor = a.idAmigo2 and a.idAmigo1 = 3) or post.idAutor = 3
and idPost > 0
group by post.id~
This is posts table, you can see it's up to ID 43
and this is the result from the query i posted, you can see it doesn't show the number of likes for idPost 43 because it's 0