All pastes #519574 Raw Edit

Anonymous

public sql v1 · immutable
#519574 ·published 2007-05-29 18:20 UTC
rendered paste body
SELECT b.bra_code, b.bra_location, at.acctyp_code, at.acctyp_desc, if(at.acctype_code, SUM(a.accnt_bal), '$0') AS "Total Current Value"FROM BRANCH b, CUSTOMER c, ACCOUNT a LEFT OUTER JOIN ACCTYPE at on at.acctyp_code = a.acctyp_codeWHERE c.cust_no = a.cust_no  AND c.bra_code = b.bra_code  AND at.acctyp_code = a.acctyp_codeGROUP BY b.bra_code, b.bra_location, at.acctyp_code, at.acctyp_descORDER BY b.bra_code;