I need to find same items duplicated in a database with/without a leading zero. Examples:

You can see my query below but it doesn't find the items with the issue:
SELECT A.LOCID, B.LOCID2
FROM (
SELECT LOCID
FROM TABLENAME
WHERE regexp_like( LOCID, '^[[:digit:]]*$') -- LOCID only digital characters
AND LOCID LIKE '0%'
)AS A
inner join (
--SELECT TRIM(LEADING '0' FROM LOCID ) AS LOCID2
SELECT LOCID AS LOCID2
FROM TABLENAME
WHERE LOCID NOT LIKE '0%'
and regexp_like( LOCID, '^[[:digit:]]*$')
) AS B
ON A.LOCID = B.LOCID2;
You can use
REGEXP_REPLACEfunction to remove leading zeros e.g.which yields
10011. So you can join on the replaced ids rather than actual ones.You can test it with this:
This gives you: