-1

I am trying to check if a particular value exists in a list of ltree column. For example path column contains values {1.2.270, 1.270.3, 1.302.270.70}. I am trying to find if the value 270 exists in any of these 3 paths. But it is not working if I am using IN or ANY keywords.

Klaus
  • 59
  • 1
  • 5
  • Please visit the help center, take the tour to see what and How to Ask. Do some research - search SO for answers. If you get stuck, post a minimal reproducible example of your attempt, noting input and expected output using the [<>] snippet editor. – Sund'er Aug 24 '22 at 12:44

1 Answers1

0

Use documentation

SELECT '{1.2.270, 1.270.3, 1.302.270.70}'::ltree[] ~ lquery('*.270.*')
Frank Heikens
  • 117,544
  • 24
  • 142
  • 135
Alex Bran
  • 39
  • 3