title: MySQL GROUP_CONCAT with Nulls
body: <p>Is there an option to make MySQL's Group_Concat function include nulls?</p>
  
  <p>Consider the following example from my source table:</p>
  
  <pre><code>userId, questionId, selectionId
  7, 3, NULL
  7, 4, 1
  7, 5, 2
  </code></pre>
  
  <p>When I query on the selection table with GROUP_CONCAT, I get the following:</p>
  
  <pre><code>7, 4=1,5=2
  </code></pre>
  
  <p>I would like to get the following:</p>
  
  <pre><code>7, 3=NULL,4=1,5=2
  </code></pre>
  
  <p>For reference, my query looks like this:</p>
  
  <pre><code>Select userId, GROUP_CONCAT(CONCAT(questionId, '=', selectionId))
  From selection
  Group by userId;
  </code></pre>
  
  <p>I also tried adding an IFNULL like this:</p>
  
  <pre><code>Select userId, GROUP_CONCAT(IFNULL(CONCAT(questionId, '=', selectionId), 'NULL'))
  From selection
  Group by userId;
  </code></pre>
  
  <p>but that produced the following:</p>
  
  <pre><code>7, NULL,4=1,5=2
  </code></pre>
  
  <p>Note - There is one other complexity that I forgot to include. The selectionId is a foreign key to another table. I use a left outer join to the selection_text table. My real query includes fields from that table (these fields resolve to NULL since the selectionId is null).</p>