Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

Joining AP_Invoice_All with Po_Headers_All

Sachin kumarMar 20 2024

Hi.

In my PO_Headers_All table, there are 900,000 records. In my PO_Invoices_ALL table, there are 880,000 invoice_IDs.

When I join these two tables using the below conditions, I am getting only 550,000 Invoice_IDs out of 880,000 in the table. Am I doing anything wrong here? Why my query returns less records? Please help!

I am using the below query

select count( distinct i.invoice_id)

from po_headers_all h

inner join po\_lines\_all                              l      on h.PO\_HEADER\_ID           = l.PO\_HEADER\_ID

inner join po\_d istributions\_all               po\_d   on l.po\_line\_id             = po\_d.po\_line\_id

inner join ap\_invoice\_distributions\_all        ap\_d   on po\_d.PO\_DISTRIBUTION\_ID  = ap\_d.PO\_DISTRIBUTION\_ID

inner join ap\_invoices\_all     i      on ap\_d.invoice\_id          = i.invoice\_id
Comments
Post Details
Added on Mar 20 2024
0 comments
63 views