Guest User

Untitled

a guest
Sep 17th, 2021
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2. m.id, m.nom, m.email,
  3. SUM(CASE WHEN su.paid > 0 THEN su.expected_amount ELSE 0 END) AS paye,
  4. SUM(su.expected_amount) AS total
  5.  
  6. FROM membres m
  7.  
  8. LEFT OUTER JOIN services_users su
  9. ON su.id_user = m.id
  10.  
  11. GROUP BY m.id,m.nom,m.email
  12. ORDER BY nom ASC
RAW Paste Data