title: Postgres query to get value if all in column are equal
body: <p>I have a table with metadata and I need to get the value if they are all equal, or if they are not equal then return 'mixed', or if all are null then return null. </p>
  
  <pre><code>id   |   color   |   size  |   shape   |  area
   1   |   blue    |   small |   square  | 
   2   |           |   small |   circle  |
   3   |   blue    |   small |   oval    |
   4   |   blue    |   small |   oval    |
  
  select distinct color, size, shape, area
  from table
  where id = 1 or id = 2 or id = 3;
  </code></pre>
  
  <p>The expected result would be one result with the following-</p>
  
  <p>'mixed', 'small', 'mixed', null</p>