All pastes #946703 Raw Edit

jcrawford

public sql v1 · immutable
·published 2008-03-17 21:36 UTC
rendered paste body
SELECT COUNT( n.* ) AS news_count, COUNT( p.* ) AS polls, COUNT( b.* ) AS blogs, COUNT( bc.* ) + COUNT( nc.* ) + COUNT( pc.* ) + COUNT( vc.* ) AS commentsFROM news_article_to_user n, poll p, blog b, video v, comment_blog bc, comment_news nc, comment_poll pc, comment_video vcWHERE n.user_id =31AND p.user_id =31AND b.user_id =31AND v.user_id =31AND bc.user_id =31AND nc.user_id =31AND pc.user_id =31AND vc.user_id =31