fixed query

This commit is contained in:
2024-06-07 19:09:05 +02:00
parent c151fb8320
commit c04b12769a

View File

@@ -170,8 +170,8 @@ public class Routes {
com.postdate,
com.postlocation[0],
com.postlocation[1],
(SELECT count(*) FROM reaction WHERE reaction.post = com.child AND positive = TRUE) AS positive,
(SELECT count(*) FROM reaction WHERE reaction.post = com.child AND positive = FALSE) AS negative
(SELECT count(*) FROM reactions WHERE reactions.post = com.child AND reactions.positive = TRUE) AS positive,
(SELECT count(*) FROM reactions WHERE reactions.post = com.child AND reactions.positive = FALSE) AS negative
FROM
(SELECT * FROM comments inner join posts ON comments.child = posts.id) com
inner join targets ON targets.id = com.parent