Duplicates Customer Number
Dear All,
im trying to implement a query to select some customers but i got a duplicate values:
how can i remove them :
the query is as below:
select distinct
cust1.rac_bill_to_customer_num cst
,cust1.rac_bill_to_customer_name
from
apps.ra_customer_trx_partial_v cust1
,apps.ra_customer_trx_partial_v cust2
where
cust1.customer_trx_id = cust2.customer_trx_id
and cust1.BILL_TO_CUSTOMER_ID in (select cat.customer_id
from apps.ar_customers_all_v cat
)
and cust2.gd_gl_date < :P_TRX_FROM_DATE
and cust1.invoice_currency_code = nvl(NULL,cust1.invoice_currency_code)