In Condition, using substr
<p>I want to get all the data from the column, but my source will only give me part of the information on that same column, for example my source will give me the following data (Not inserted on the DB, excel file):</p>

<pre><code>Id_Source
----------------
ABC
A1B
B23
CGT
TGR
FRT
</code></pre>

<p>And my oracle table information looks like this:</p>

<pre><code>Id
----------------
ABC__120116
A1B__130115
B23__123534
CGT__125347
TGR__456873
FRT__124652
</code></pre>

<p>I tried to do it using a substr function, but it doesnt seem to work, here is what I have so far.</p>

<pre><code>select id
from Tbl1
where
id in (substr('ABC',1,3));
</code></pre>

<p>I also tried it with an OR conditional which works, but I have thousands of records and the search takes too long.</p>

<pre><code> select id 
from tbl1
where
and (
transaction_id like 'ABC%' or
transaction_id like 'A1B%' or
transaction_id like 'B23%');
</code></pre>

<p>Is there any way to get the in conditional with substring, or any other way to make the search faster?</p>