Greetings!
The Query is about users, comments and the action on the comments (LIKE or DISLIKE). I try, but I do not know how to make the following return:
comment data, user data, LIKE total, DISLIKE total, action action: this will be of the user who has logged in.
The structure of the tables are the following:
user: id, etc ...
Comment: id, id_user, id_publication
action: id, comment_id , user_id, type (LIKE or DISLIKE)
I've tried the following partial queries that work:
SELECT * FROM comentario INNER JOIN usuario ON comentario.id_usuario = usuario.id WHERE comentario.id_publicacion = XXXXX
SELECT COUNT(*), tipo FROM accion WHERE id_comentario = XXXXX GROUP BY tipo
I'm not very good with SQL, thanks in advance.