add
remove
split
language
show hidden
hide
db<>fiddle
Db2
DuckDB
Firebird
MariaDB
MySQL
Oracle
Postgres
SQL Server
SQLite
TimescaleDB
YugabyteDB
11.1
11.5
12.1
1.4 LTS
3.0
4.0
5.0
10.2
10.3
10.4
10.5
10.6
10.7
10.8
10.9
10.11
11.4
11.8
12.3
5.5
5.6
5.7
8.0
8.4
9.7
11g Release 2
18c
21c
23ai
23c
26ai
8.4
9.3
9.4
9.5
9.6
10
11
12
13
14
15
16
17
18
19 beta 3
2012
2014
2016
2017
2017 (Linux)
2019
2019 (Linux)
2022
2025
3.8
3.16
3.27
3.39
3.45
3.53
2.11
2.14
2.28
2.6
2.8
2.18
2024.2 LTS
2025.2 LTS
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
Sakila
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
AdventureWorks
no sample DB
no sample DB
AdventureWorks
no sample DB
AdventureWorks
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
no sample DB
run
abort
markdown
clear
donate
feedback
about
By using db<>fiddle, you agree to license everything you submit by
Creative Commons CC0
.
create table t (id, string1, string2) as select 1, '100,101,201', '1,2,3,4' from dual union all select 2, '100,103,201,202', '1,4,9,10' from dual union all select 3, '101,102,200', '1,3,4' from dual;
3 rows affected
create or replace type numtab is table of int
-- или с доступной "из коробки" select * from mdsys.sdo_numtab (1,2,3)
COLUMN_VALUE
1
2
3
with function toNumTab (str varchar2) return numtab is pos int := 1; len int := 0; r numtab := numtab (); begin <<split>> loop len := instr (str||',', ',', pos); exit split when len = 0; r.extend; r(r.last) := to_number (substr (str, pos, len-pos)); pos := len+1; end loop; return r; end; args (arg1, arg2) as ( select numtab (100, 201), numtab (1, 4) from dual ) select id from t, args where args.arg1 submultiset of toNumTab (string1) and args.arg2 submultiset of toNumTab (string2)
ID
1
2
with t1 (id, nt1, nt2) as ( select id, (select cast (collect (to_number (column_value)) as numtab) from xmlTable (string1)), (select cast (collect (to_number (column_value)) as numtab) from xmlTable (string2)) from t ), args (arg1, arg2) as ( select numtab (100, 201), numtab (1, 4) from dual ) select id from t1, args where arg1 submultiset of t1.nt1 and arg2 submultiset of t1.nt2
ID
1
2