select users.id, DATEDIFF(ss, users.creationdate, CURRENT...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Music Fans Meta

Q&A about the site for music historians, critics, and fans

select
  users.id,
  DATEDIFF(ss, users.creationdate, CURRENT_TIMESTAMP) as AccountAge,
  count(comments.id) as comment_count,
  count(posts.id) as post_count
from users
  left join comments on users.id = comments.userid
  left join posts on users.id = posts.owneruserid
group by users.id, users.creationdate
order by rand()

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results