Created
November 30, 2011 02:02
-
-
Save basicxman/1407638 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT days.*, name, SUM(value) AS total_points FROM "days" LEFT JOIN points ON points.day_id = days.id LEFT JOIN tasks ON tasks.id = points.task_id WHERE "days"."user_id" = 2 AND (value IS NOT NULL) GROUP BY task_id, date ORDER BY date; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment