Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. 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, (
  2. select count(1) from jos_discuss_votes where `post_id` = a.`id`
  3. ) as voteCount , (
  4. select count(1) from jos_discuss_votes where `post_id` = a.`id` and `value` = '-1'
  5. ) as num_negvote
  6. from jos_discuss_posts as a
  7. left join jos_discuss_thread as b
  8.  
  9. on a.`id` = b.`post_id`;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement