title: SQL conditional aggregation?
body: <p>Let's say I have the following table:</p>
  <pre><code>  name virtual message
  --------------------------
    a       1     'm1'
    a       1     'm2'
    a       0     'm3'
    a       0     'm4'
    b       1     'm5'
    b       0     'm6'
    c       0     'm7'
  </code></pre>
  <p>I want to group by name but only concat the message if virtual is 1.</p>
  <p>The result I am looking for is:</p>
  <pre><code>name  concat_message
  ---------------------
  a         'm1,m2'
  b            'm5'
  c              ''
  </code></pre>
  <p>I couldn't find a way to conditionally aggregate using <code>string_agg</code>.</p>