daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest May 17th, 2018 110 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.               `us`.`id`               AS `user`,
  3.                `curr`.`code`          AS `currency`,
  4.                `o`.`status`           AS `orderStatus`,
  5.                SUM(o.income_user_aff) AS `amount`
  6.              FROM `user_source` `us` LEFT JOIN `user` `u` ON u.user_source_id = us.id
  7.                LEFT JOIN `click` `c` ON c.user_id = u.id
  8.                LEFT JOIN `order` `o` ON o.click_id = c.id
  9.                LEFT JOIN `currency` `curr` ON curr.id = o.income_currency_id
  10.              WHERE o.id IS NOT NULL
  11.              GROUP BY `u`.`id`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top