title: SQL – consolidate rows after SELECT CASE statement
body: <p>I want to consolidate rows with matching IDs returning from a SELECT CASE statement. I'm using <code>pgAdmin 3</code> on a <code>PG-9.3.4</code> database.</p>
  
  <p>This is what I'm getting on pgAdmin:
  <img src="https://i.stack.imgur.com/o4cir.png" alt="query result"></p>
  
  <p>And this is what I want to get: <img src="https://i.stack.imgur.com/5NMxa.jpg" alt="expected result"></p>
  
  <p>I've tried grouping it, or joining the result to the table itself, but din't work. Any ideas?</p>
  
  <p>My query code:</p>
  
  <pre><code>SELECT
      CASE
      WHEN t1.material LIKE '%Refuse%'
          THEN t1.disposal
      ELSE NULL
  END AS msw_disp,
  
      CASE
      WHEN t1.material LIKE '%Met%'
          THEN t1.disposal
      ELSE NULL
  END AS mgp_disp,
  
      CASE
      WHEN t1.material LIKE '%Paper%'
          THEN t1.disposal
      ELSE NULL
  END AS pap_disp, t1.district
  
  FROM dsny_net t1
  </code></pre>