I realised the problem was duplicates in the first table so fixed with a distinct, my new problem with the code below is that in the case of substr(aun_code) I want to find those where they have additional characters at the end. please help! Code below:-
cheers Sam
SELECT DISTINCT (scr_prorefno_auncode), aun_code, aun_auy_code,
RTRIM (scr_prorefno_auncode)
FROM service_charge_rates, admin_units
WHERE scr_calcd_weighting_tot IS NULL
AND scr_scb_scp_start_date = '01-apr-2004'
AND SUBSTR (scr_prorefno_auncode, 5, 10) = SUBSTR(aun_code(+), 5,10)
AND scr_prorefno_auncode LIKE 'RPAU%'
ORDER BY scr_prorefno_auncode