Skip to content
Advertisement

How to write an array literal in SQL?

Is it possible to use an array literal in Oracle, such as:

Or:

Or what’s the simplest (i.e., possible not in PL/SQL?) way to do this?

Advertisement

Answer

if you wanta flexible list, y an use a type like this

ID | INTLIST
-: | :------
ID | COLUMN_VALUE
-: | -----------:
 1 |            1
 1 |            2
 1 |            3
ID | COLUMN_VALUE
-: | -----------:
 1 |            3

db<>fiddle here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement