In a varchar2 field (table1.field1), I have something like this: ;number1;number2;.......;numberN;
I want use this value in a IN statement, something like:
SELECT * FROM table2 WHERE table2.field2 IN table1.field1
In a varchar2 field (table1.field1), I have something like this: ;number1;number2;.......;numberN;
I want use this value in a IN statement, something like:
SELECT * FROM table2 WHERE table2.field2 IN table1.field1
If the values of table2.field2 are strings like
number1
number2
Then Try this:
SELECT *
FROM table2
WHERE EXISTS
(
SELECT 1
FROM table1
WHERE table1.field1 LIKE '%;' || table2.field2 || ';%'
)
If the table2 are similar to what you have in table1.field1 then try this:
SELECT *
FROM table2
WHERE field2 IN
(
SELECT field1
FROM table1
)