Trying to query for values in a table, where two arrays have the same value, but not necessarily in the same order.
given: a column with a value of
{'first', 'second'}
expected:
SELECT * FROM my_table WHERE array_column = {'second', 'first'}
expected:
SELECT * FROM my_table WHERE array_column = {'second'}
result 1
{'first', 'second'}
result 2: nothing
I can sort the input array I am querying with, but I cannot guarantee that the database will have those arrays stored in that same order. Is there an easy way to do this?
&&: postgresql.org/docs/current/static/functions-array.html