title: How to use coalesce, or a variation, to pull more than 1 value?
body: <p>This is a question about <code>COALESCE</code> in PostgreSQL. In a current view I am using
  <code>COALESCE</code> to grab the first <code>NOT NULL</code> value in a list:</p>
  
  <pre><code>COALESCE(vw_header_to_node_13.subsetname,
  vw_header_to_node_12.subsetname, 
  vw_header_to_node_11.subsetname,
  vw_header_to_node_10.subsetname,
  vw_header_to_node_9.subsetname,
  vw_header_to_node_8.subsetname,
  vw_header_to_node_7.subsetname,
  vw_header_to_node_6.subsetname,
  vw_header_to_node_5.subsetname,
  vw_header_to_node_4.subsetname,
  vw_header_to_node_3.subsetname,
  vw_header_to_node_2.subsetname,
  vw_header_to_node_1.subsetname,
  vw_header_to_node.subsetname,
  vw_header_to_node.setname)
  AS prctr1
  </code></pre>
  
  <p>I have just been informed that instead of grabbing just the first <code>NOT NULL</code> field, I now need to grab the first <code>NOT NULL</code> field and the following 2 fields after the first <code>NOT NULL</code> field. For instance, if <code>vw_header_to_node_8.subsetname</code> was the first <code>NOT NULL</code> field I would want to grab <code>vw_header_to_node_8.subsetname</code>, <code>vw_header_to_node_7.subsetname</code>, &amp; <code>vw_header_to_node_6.subsetname</code>. I know this is not how <code>COALESCE</code> normally functions, but does anyone know of any variations or ways to make this happen?</p>