User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
SQL spot the issue
SELECT * FROM PostEntity

JOIN ProfileEntity ON PostEntity.authorId = ProfileEntity.profileId
LEFT JOIN PostEntity AS Quote ON PostEntity.quoteId = Quote.postId
LEFT JOIN ProfileEntity AS QuoteProfile ON Quote.authorId = QuoteProfile.profileId
LEFT JOIN PostEntity AS BoostedPost ON PostEntity.boostedPostId = BoostedPost.postId
LEFT JOIN ProfileEntity AS BoostedPostProfile ON BoostedPost.authorId = BoostedPostProfile.profileId

WHERE PostEntity.authorId = :authorId || BoostedPost.authorId = :authorId
ORDER BY PostEntity.createdAt DESC;
2
0
0
0
User avatar
Q[wu]eerty (he/him) @queerty@kinkycats.org
5mo
SQL @kitten || instead of OR.
1
0
1
0
User avatar
Q[wu]eerty (he/him) @queerty@kinkycats.org
5mo
SQL @kitten and too many instances of ProfileEntity 😅
1
0
1
0
User avatar
pathetic piss kitten @kitten@elizabeth.cat
5mo
SQL @queerty yeah, a very circular query ​:neocat_laugh_sweat:​
0
0
1
0