Hello All,
Can you help me with that SQL query i need to select the PO number with the invoices details which mention in my query, that query is running with no end
| select i.invoice_num,v.vendor_name,i.invoice_date,ps.due_date, |
i.invoice_amount,i.amount_paid,ps.amount_remaining, SUM(i.invoice_amount)as"Invoice_Amount" ,sum(ps.amount_remaining)as "Amount_Remaining",pha.segment1 as PO_Number
| FROM | ap_payment_schedules_all ps, |
| | ap_invoices_all i, |
| | po_vendors v, |
| | po_vendor_sites_all vs, |
| | po_headers_all pha |
WHERE i.invoice_id = ps.invoice_id
| AND | i.vendor_id = v.vendor_id |
| AND | i.vendor_site_id = vs.vendor_site_id |
group by v.vendor_name,i.invoice_num,i.invoice_date,ps.due_date,i.invoice_amount,i.amount_paid,
ps.amount_remaining,pha.segment1
Order by v.vendor_name,i.invoice_num;
Thank You