Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT id, count(post_id) as num_comm from posts
- INNER JOIN comments on id = post_id
- WHERE (UNIX_TIMESTAMP(posts.time_posted) - UNIX_TIMESTAMP(comments.time_posted)) < (30 * 60)
- AND comments.reply_to_id = 0
- GROUP BY id
- ORDER BY num_comm ASC;
Add Comment
Please, Sign In to add comment