AS viewable_play_uu FROM completed WHERE viewable_time >= 1000 AND ( campaign_id = 12345 AND TIMESTAMP >= '2014-07-16 00:00:00' AND TIMESTAMP < '2014-07-17 00:00:00' ) AND campaign_id IS NOT NULL GROUP BY campaign_id ORDER BY campaign_id; campaign_id | viewable_play_uu ---------------+------------------ 12345 | 88888888 (1 行)