What is Query for getting customers having multiple accounts?
and How to get customers having multiple accounts?
SELECT hca.account_number,rc.customer_name, hp.party_type,hp.party_name
FROM hz_parties hp, hz_Cust_Accounts hca,ar.ra_customers rc
WHERE hp.party_id = hca.party_id
AND hca.cust_account_id IN (
FROM ap_bank_account_uses_all bauses,
WHERE bauses.external_bank_account_id = bacct.bank_account_id
AND primary_flag = 'Y'
GROUP BY customer_id)
HAVING COUNT (DISTINCT (external_bank_account_id)) > 1)