1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| SELECT count(DISTINCT (`transaction1`.`idTRANSACTION`)),
SUM(DISTINCT `transaction1`.`TRX_MONTANT`),
`transaction1`.`TRX_CODE_OCCASION`,
`transaction1`.`TRX_DATE`,
`code1`.`CODE_OCCASION`,
`code1`.`CODE_OCCASION_LIBELLE`,
`code1`.`ASSOCIATION`
FROM
`stat`.`transaction` `transaction1`
LEFT JOIN
`stat`.`code` `code1` ON `transaction1`.`TRX_CODE_OCCASION` = `code1`.`CODE_OCCASION`
WHERE
(`transaction1`.`TRX_DATE` >= { ts '2012-07-05 00:00:00' }
AND `transaction1`.`TRX_DATE` < { ts '2013-07-05 00:00:01' })
AND `code1`.`ASSOCIATION` = 'TEST'
GROUP BY `code1`.`CODE_OCCASION` |
Partager