I currently have an SQL query that lists day's Ive played and the money won, as seen below.
- Code: Select all
SELECT date_trunc('day', g.date_played) as Day, SUM( (gp.total_won - gp.total_bet) ) AS Winnings
FROM game g, game_players gp
WHERE gp.player_id = (SELECT player_id FROM players WHERE screen_name = 'alias')
AND g.date_played >= '01-Jul-2008'
AND gp.game_id = g.game_id
GROUP BY Day
ORDER BY Day ASC;
I would like to add a colum that shows me the "true hours played" for each day. As if I've played 2 hours on 4 tables, it will show 2 hours. (same as checking the box in session notes in PT2)
Help would be greatly appreciated!