having another issue with mysql query
I am using following query...
SELECT c.idx, c.club_name, s.sale_event_date, s.club_id, COUNT(*) AS
total_guests,
sum(s.qr_scanned = 1) AS total_scanned_guests,
SUM(s.rep_sale_commission ON (s.rep_id != 0 AND s.qr_scanned = 1)) AS
total_rep_commission,
SUM(s.sale_commission) AS total_admin_fees
FROM club c RIGHT JOIN
sales s ON s.club_id = c.idx
WHERE c.admin_id = 37
GROUP BY s.sale_event_date
ORDER BY s.sale_event_date DESC;
But its throwing mysql error - right syntax to use near 'ON (s.rep_id != 0
AND s.qr_scanned = 1)) AS total_rep_commission, SUM(s.' at line 3 Please
help to fix, thanks.
No comments:
Post a Comment