SQL Query to Identify all records related to an invoice in IBY_PAYMENTS_ALL
I have this query to identify iby_payments_all for an invoice. However, I see that many payment_ids in iby_payments_all are not in ap_checks_all. So, those will not come in my query for an invoice. I need to identify all invoice_ids related to a set of iby_payments_all records. Please provide me with query or query unions so I can query all iby_payments_all records related to an invoice.
SELECT ac.check_id, ip.*
FROM apps.iby_payments_all ip,
apps.ap_checks_all ac,
apps.ap_invoice_payments_all ap,
apps.ap_invoices_all ai