Subject | Left outer join not giving me the result I want |
---|---|
Author | |
Post date | 2014-02-06T19:36:08Z |
This is my query
select A.internal,A.surname,Sum(C.amount)from Accounts A inner join Accountfinancial B on A.identifier = B.accountlink
left outer join Accountitems C on B.identifier = C.account
where C.itemtype='Debit'
group by A.internal,A.surname
order by A.internal
For every record in the Accounts table there is a matching record in Accountfinancial but there might not be any transactions posted for some accounts.
I need to list every single record in accounts and include the ones that has no linked transactions in Accountitems.
But I only get the result for Accounts with transactions in Accountitems and not the ones without ( 0 Balance accounts )