Guest User

Untitled

a guest
Jun 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. SELECT id, count(post_id) as num_comm from posts
  2. INNER JOIN comments on id = post_id
  3. WHERE (UNIX_TIMESTAMP(posts.time_posted) - UNIX_TIMESTAMP(comments.time_posted)) < (30 * 60)
  4. AND comments.reply_to_id = 0
  5. GROUP BY id
  6. ORDER BY num_comm ASC;
Add Comment
Please, Sign In to add comment