Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select a.`id`, a.`parent_id` as type, a.`sum_totalvote` as postSum, b.`sum_totalvote` as threadSum, a.`vote` as postVote, b.`vote` as threadVote, (
- select count(1) from jos_discuss_votes where `post_id` = a.`id`
- ) as voteCount , (
- select count(1) from jos_discuss_votes where `post_id` = a.`id` and `value` = '-1'
- ) as num_negvote
- from jos_discuss_posts as a
- left join jos_discuss_thread as b
- on a.`id` = b.`post_id`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement