Check if any of multiple values exist in an array in Postgres
<p>Checking if one value exists in an array is pretty trivial. For example, the following will return true.</p>

<pre><code>SELECT 'hello' = ANY(ARRAY['hello', 'bees'])
</code></pre>

<p>But what if I wanted to check if any of multiple values exist in an array? For example, I want to return true if 'hello' OR 'bye' exists in an array. I want to do something like </p>

<pre><code>SELECT ['hello', 'bye'] = ANY(ARRAY['hello', 'bees'])
</code></pre>

<p>but that doesn't seem to work.</p>

<p>Edit:</p>

<p>I'm also looking to figure out how I can check if any of multiple values exist in an array where the multiple values have common prefixes.</p>

<p>For example, if I want to return true if the array contains any element with the prefix of 'hello'. So I basically want something like</p>

<pre><code>SELECT ARRAY['hello%'] &amp;&amp; ARRAY['helloOTHERSTUFF']
</code></pre>

<p>to be true.</p>