Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT artists.user_id, artists.staff_id,
- Sum(events.sum),
- Sum(goods.sum),
- FROM artists
- INNER JOIN `events` ON `artists`.`id` = `events`.`artist_id`
- INNER JOIN `goods` ON `artists`.`id` = `goods`.`artist_id`
- WHERE (`events`.`created_at` BETWEEN '2017-01-01' AND '2017-07-30')
- AND (`goods`.`created_at` BETWEEN '2017-01-01' AND '2017-07-30')
- GROUP BY artists.user_id, artists.staff_id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement