Home > Blockchain >  How to return all rows where an array column contains a given array?
How to return all rows where an array column contains a given array?

Time:01-24

I have the following table:

╔════╦════════════════════════════════════════╗
║ id ║                 value                  ║
╠════╬════════════════════════════════════════╣
║  1 ║ ['friend', 'apple', 'cat']             ║
║  2 ║ ['cat', 'friend', 'dog']               ║
║  3 ║ ['pasta', 'best-friend', 'lizard']     ║
║  4 ║ ['wildcat', 'potato', 'alices-friend'] ║
╚════╩════════════════════════════════════════╝

My goal is to return all rows where value contains a given array. For example:

  1. ['friend', 'cat'] should return rows 1 and 2.

  2. ['%friend%', '

  •  Tags:  
  • Related