outer join for tenant-saldo-query

This commit is contained in:
2021-09-15 17:31:55 +02:00
parent 97dfcbe2fb
commit b8083ec41e
2 changed files with 8 additions and 2 deletions

View File

@ -37,8 +37,7 @@ def get_tenant_with_saldo(user, token_info):
return dbGetMany(user, token_info, {
"statement": """
SELECT t.id, t.firstname, t.lastname, t.address1, sum(a.amount) AS saldo
FROM tenant_t t, account_entry_t a
WHERE a.account = t.account
FROM tenant_t t LEFT OUTER JOIN account_entry_t a ON a.account = t.account
GROUP BY t.id, t.firstname, t.lastname, t.address1
""",
"params": ()