Guest User

Untitled

a guest
Dec 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. SELECT c.id as company_id, SUM(ct.amount) as total_billed, count(l.id) as load_count
  2. FROM tbl_companies c
  3. LEFT JOIN tbl_company_transactions ct ON c.id = ct.company_id
  4. LEFT JOIN tbl_loads l ON c.id = l.company_id
  5. GROUP BY c.id;
Add Comment
Please, Sign In to add comment