SQL Language (MOSC)

MOSC Banner

I need to SUM unique values from a table (get the distributed part payment to the invoice per PO)

I need to get only the amount paid per PO, and Invoice, if two Po or invoices match numbers I get the total amount paid without distiction, and if i go to the payment history table to retrieve information I keep adding duplicates, sorry, probably this is relatively easy but I a new at Sql..Thanks in advance


TABLE 1

AP_PAYMENT_HIST_DISTS (Amount paid)

TABLE 2 AP_INVOICE_PAYMENTS_ALL (Total Invoice amont)

And my query

SELECT

dst.organization_code AS destination_organization,

-- Datos del pago

TO_CHAR(pmt.payment_date, 'DD/MM/YYYY') AS payment_date,

chk.check_number AS payment_number,

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center