Advertisement
Guest User

Untitled

a guest
Jul 10th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. SELECT date(date) as day, count(IF(name = 'red', 1, NULL)) AS "red",
  2. count(IF(name = 'blue', 1, NULL)) AS "blue",
  3. count(IF(name = 'yellow', 1, NULL)) AS "yellow" FROM test1 group by day with rollup
  4.  
  5. select date(date) as day, count(*) as total from test2 group by day with rollup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement