JOIN Queries
The CData Python Connector for Zoho Books supports standard SQL joins like the following examples:
Inner Join
An inner join selects only rows from both tables that match the join condition:
Joining ChartOfAccounts with BankTransactions
SELECT ChartOfAccounts.ChartAccountId, Banktransactions.AccountId, TransactionId, ChartOfAccounts.AccountName, Banktransactions.AccountName, ChartOfAccounts.AccountType, Banktransactions.AccountType FROM ChartOfAccounts INNER JOIN banktransactions ON banktransactions.AccountId = ChartOfAccounts.ChartAccountIdJoining ChartOfAccounts with ReportsAccountTransactionsDetails
SELECT * FROM ChartOfAccounts INNER JOIN ReportsAccountTransactionsDetails ON ReportsAccountTransactionsDetails.AccountId = ChartOfAccounts.ChartAccountId WHERE FromDate = '2022-09-01' and ToDate = '2022-11-16' and ChartAccountId = 3519201000000000370Joining ChartOfAccounts with BankAccounts
SELECT * FROM ChartOfAccounts INNER JOIN BankAccounts ON BankAccounts.AccountId = ChartOfAccounts.ChartAccountIdLeft Join
A left join selects all rows in the FROM table and only matching rows in the JOIN table:
SELECT ChartOfAccounts.ChartAccountId, Banktransactions.AccountId, TransactionId, ChartOfAccounts.AccountName FROM ChartOfAccounts LEFT OUTER JOIN BankTransactions ON banktransactions.AccountId = ChartOfAccounts.ChartAccountId