title: SQL query to list only the 'non null' fields in result
body: <p>I have a table with 70 plus columns.  I often search the table for a single row.</p>
  
  <p>Ex:</p>
  
  <pre><code>select * from customer where customer_id='xyz';
  </code></pre>
  
  <p>The <code>customer_id</code> is unique.</p>
  
  <p>In the result, there will most probably be 30 to 40 columns with null value.</p>
  
  <p>I am always interested only in the non-null fields.  </p>
  
  <p><strong>Is there a way in SQL to list out only those columns that are non-null?</strong> </p>
  
  <p>PS: Unfortunately, the non-null fields will not be the same fields for all customers.  Say, If 'Customer A' has null in 'Column R', 'Customer B' might have a valid value in that column.  And lastly, my query will always be focused on only 1 customer at any given time. </p>
  
  <p>Brief example: </p>
  
  <p>query: </p>
  
  <pre><code>select * from customer where cust_id='826122';
  </code></pre>
  
  <p>actual result: </p>
  
  <p>cust_id - 826122</p>
  
  <p>cust_fname - martha</p>
  
  <p>cust_lname - kane</p>
  
  <p>cust_alt_add - null</p>
  
  <p>cust_cell_acode - 210</p>
  
  <p>cust_home_phone - null</p>
  
  <p>expected result: (I don't want the columns with null values to appear in my result)</p>
  
  <p>cust_id - 826122</p>
  
  <p>cust_fname - martha</p>
  
  <p>cust_lname - kane</p>
  
  <p>cust_cell_acode - 210</p>