I have two tables trans_transaction and opening_balances. The transactions are to be inserted in the trans_transaction table. I need to fetch the opening_balance, closing_balance from the trans_transaction table. The opening_balances table is used for the first time when there is no transaction for the account in the trans_transaction table. I've also written a query but the query fails if there is no record in the trans_transaction table and fails to take the data from the opening_balances tableI have two tables trans_transaction and opening