Skip to content
Advertisement

How to write a WHERE clause for NULL value in ARRAY type column?

I created a table which contains a column of string ARRAY type as:

I then added rows which contain various values for that array, including an empty array and missing data (null):

pgAdmin shows table like this:

Table in pgAdmin

I am trying to get a row which contains a null value ([null]) in the list column but:

…returns no rows and:

…returns row with id = 4.

How to write WHERE clause which would target NULL value for column of ARRAY type?

Advertisement

Answer

demo:db<>fiddle

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