Created
April 28, 2015 22:57
-
-
Save minorsecond/e5de107f909becbd07b5 to your computer and use it in GitHub Desktop.
Sanity Check: Get sum of time worked (t_worked) of each row in sqlite database.
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
t_worked = session.query(Clocktime).filter(Clocktime.p_uuid == p_uuid).order_by(Clocktime.id.desc()).all() | |
for i in tworked: | |
_sum_time += i.t_worked | |
eg. I want sum of time for p_uuid==1, _sum_time should equal '8'. | |
p_uuid t_worked | |
=================== | |
1 1 | |
1 2 | |
1 5 | |
2 2 | |
2 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment