Index: trunk/fundraiser-statistics/fundraiser-scripts/sql/report_campaign_totals.sql |
— | — | @@ -3,13 +3,17 @@ |
4 | 4 | |
5 | 5 | select |
6 | 6 | |
7 | | -utm_campaign, |
8 | | -sum(not isnull(contribution_tracking.contribution_id)) as donations |
| 7 | +faulkner.test.test_name, |
| 8 | +drupal.contribution_tracking.utm_campaign, |
| 9 | +sum(not isnull(contribution_tracking.contribution_id)) as donations, |
| 10 | +min(receive_date) as earliest_timestamp |
9 | 11 | |
10 | | -from drupal.contribution_tracking left join civicrm.civicrm_contribution ON (drupal.contribution_tracking.contribution_id = civicrm.civicrm_contribution.id) |
| 12 | +from |
| 13 | +drupal.contribution_tracking left join civicrm.civicrm_contribution ON (drupal.contribution_tracking.contribution_id = civicrm.civicrm_contribution.id) |
| 14 | +left join faulkner.test on faulkner.test.utm_campaign = drupal.contribution_tracking.utm_campaign |
11 | 15 | |
12 | 16 | where receive_date >= %s and receive_date < %s |
13 | 17 | |
14 | | -group by 1 |
15 | | -order by 2 desc; |
| 18 | +group by 2 |
| 19 | +order by 3 desc; |
16 | 20 | |