For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!
Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.
with table1 as ( select 'xx' col1 from dual union all select 'yy' col1 from dual union all select '01' col1 from dual union all select '02' col1 from dual union all select '03' col1 from dual union all select '04' col1 from dual ), table2 as ( select 1 col1 from dual union all select 2 col1 from dual union all select 3 col1 from dual union all select 4 col1 from dual ) select * from table1 a,table2 b where case when not RegExp_Like(a.col1,'^[0-9]+$') then 0 when to_number(a.col1) = b.col1 then 1 else 0 end = 1; CO COL1 -- ---- 01 1 02 2 03 3 04 4
create table1 ( col1 varchar2(20) ); create table2 ( col1 number(10) );
with table1 as ( select 'xx' col1 from dual union all select 'yy' col1 from dual union all select '01' col1 from dual union all select '02' col1 from dual union all select '03' col1 from dual union all select '04' col1 from dual ),table2 as ( select '01' col1 from dual union all select '02' col1 from dual union all select '03' col1 from dual union all select '04' col1 from dual )
),table2 as ( select 1 col1 from dual union all select 2 col1 from dual union all select 3 col1 from dual union all select 4 col1 from dual )
SELECT * FROM table1 JOIN table2 ON NVL ( LTRIM (table1.col1, '0') , '0' ) = TO_CHAR (table2.col1) ;