Difference between revisions of "Sales queries"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
==Useful Info for Queries== | ==Useful Info for Queries== | ||
Job IDs: | Job IDs: | ||
+ | |||
+ | ===Directly Store Related=== | ||
*Sales Admin - 124 | *Sales Admin - 124 | ||
*Safari - 111 | *Safari - 111 | ||
*Thrift Store - 16 | *Thrift Store - 16 | ||
− | |||
*Meeting - 118 | *Meeting - 118 | ||
*Thrift Store Admin - 135 | *Thrift Store Admin - 135 | ||
*Online Sales - 68 | *Online Sales - 68 | ||
− | Worker IDs: | + | ===Not Directly Store Related=== |
+ | |||
+ | *Meeting Prep - 108 | ||
+ | *Supply Check - 13 | ||
+ | *Reply to Email - 69 | ||
+ | *Meeting Prep - 108 | ||
+ | *Documentation - 112 | ||
+ | *Training - 117 | ||
+ | |||
+ | |||
+ | ===Worker IDs:=== | ||
*Leah - 70001 | *Leah - 70001 |
Revision as of 12:02, 26 January 2011
Useful Info for Queries
Job IDs:
Directly Store Related
- Sales Admin - 124
- Safari - 111
- Thrift Store - 16
- Meeting - 118
- Thrift Store Admin - 135
- Online Sales - 68
Not Directly Store Related
- Meeting Prep - 108
- Supply Check - 13
- Reply to Email - 69
- Meeting Prep - 108
- Documentation - 112
- Training - 117
Worker IDs:
- Leah - 70001
- Ian - 53617
- Tony - 60007
- Paco - 50838
- Mike - 70017
- Luiz - 31639
- Sergio - 34779
- E-beth - 60002
- Sophia - 12386
Queries
- Total of Monthly XX hours logged (fill in job_id):
SELECT EXTRACT (MONTH FROM worked_shifts.date_performed) AS Monthly, SUM (duration) FROM worked_shifts WHERE date_performed BETWEEN ('2010-01-01') AND ('2010-12-31') AND job_id ='XX' GROUP BY 1 ORDER BY Monthly ASC;
- Total of Monthly XX hours logged for XXXXX worker (fill in job_id and worker_id):
SELECT EXTRACT (MONTH FROM worked_shifts.date_performed) AS Monthly, SUM (duration) FROM worked_shifts WHERE date_performed BETWEEN ('2010-01-01') AND ('2010-12-31') AND job_id = 'XX' AND worker_id = 'XXXXX' GROUP BY 1 ORDER BY Monthly ASC;