There is an array[10,20] and I want to know if it is a subset of array[20,30,10] or not. Is there a postgresql function or operation to determine if one array contains another?
Desired outcomes:
[10,20] and [30,20,10] - true
[10,20] and [10,30] - false
[10,20] and [20,10] - true
[10,20] and [10,20] - true
Like this,perhaps:
SELECT ARRAY[10,20] <@ ARRAY[30,20,10];
http://www.postgresql.org/docs/current/static/functions-array.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With