select mac_no, REGEXP_replace(mac_no,'[^[:digit:]]') from mrel.macdet -where dept_code = 3 and macdet.MC_TYPE_SRLNO = 7 SELECT distinct item_code FROM STORES.STORES_ITEM_LEDGER where ccode in (5,6) and type = 'I' and trans_date > sysdate - 365