title: Is there an aggregate function AND / OR for boolean types in Snowflake SQL?
body: <p>Given that I have a table like this </p>
  
  <pre><code>ID  X
  1   TRUE
  1   FALSE
  2   FALSE
  2   FALSE
  </code></pre>
  
  <p>I would like to achieve the following result:</p>
  
  <pre><code>ID  BOOL_OR(X)
  1   TRUE
  2   FALSE
  </code></pre>
  
  <p>That is , I want to <code>GROUP BY ID</code> and aggregate the boolean values of <code>X</code> using the boolean OR operator. </p>
  
  <p>PostgreSQL has <a href="https://www.postgresql.org/docs/12/functions-aggregate.html" rel="nofollow noreferrer"><code>bool_or()</code></a>  that I can use like this </p>
  
  <pre><code>with t1 as
           (
               select *
               from (values (1, true)
                          , (1, false)
                          , (2, false)
                          , (2, false)) AS t1 (id, x)
           )
  select id, bool_or(x)
  from t1
  group by id;
  -- results
  ID  BOOL_OR(X)
  1   TRUE
  2   FALSE
  </code></pre>
  
  <p>The same query in Snowflake SQL gives <code>SQL compilation error: Invalid identifier BOOL_OR</code>, which is <strong>no surprise</strong> since the <a href="https://docs.snowflake.net/manuals/sql-reference/functions-aggregation.html" rel="nofollow noreferrer">Snowflake documentation for Aggregate functions</a> does not list <code>BOOL_OR</code>. </p>
  
  <p>So my question is there some other alternative way to get the same effects as PostgreSQL's <code>bool_or</code> and <code>bool_and</code> in Snowflake SQL?</p>