title: How to turn 'this' SELECT to multiple strings
body: <p>How I can turn this SELECT to output with strings (which is below this example)?</p>
  
  <p><a href="http://sqlfiddle.com/#!9/6a87fa/4" rel="nofollow noreferrer">SQLFiddle</a></p>
  
  <pre><code>nose_1
  
  |id|class|about_education|
  | 1|    1|            a01|
  | 2|    0|            a02|
  
  coins_2
  
  |id|class|about_education|
  | 1|    1|            a01|
  | 2|    0|            a02|
  
  money_3
  
  |id|class|about_education|
  | 1|    1|            a01|
  | 2|    1|            a10|
  
  
  SELECT 
       COUNT(CASE WHEN about_education = 'a01' and class = 1 then 1 else 0 end) a01,
       COUNT(CASE WHEN about_education = 'a02' and class = 1 then 1 else 0 end) a02, 
       COUNT(CASE WHEN about_education = 'a03' and class = 1 then 1 else 0 end) a03, 
       COUNT(CASE WHEN about_education = 'a04' and class = 1 then 1 else 0 end) a04, 
       COUNT(CASE WHEN about_education = 'a05' and class = 1 then 1 else 0 end) a05, 
       COUNT(CASE WHEN about_education = 'a06' and class = 1 then 1 else 0 end) a06, 
       COUNT(CASE WHEN about_education = 'a07' and class = 1 then 1 else 0 end) a07, 
       COUNT(CASE WHEN about_education = 'a08' and class = 1 then 1 else 0 end) a08, 
       COUNT(CASE WHEN about_education = 'a09' and class = 1 then 1 else 0 end) a09,
       COUNT(CASE WHEN about_education = 'a10' and class = 1 then 1 else 0 end) a10
  FROM 
  (
    SELECT id,class,about_education from nose_1
    UNION ALL
    SELECT id,class,about_education FROM coins_2
    UNION ALL
    SELECT id,class,about_education FROM money_3
  ) t
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>$check_a01 = 3;
  $check_a02 = 0;
  $check_a03 = 0;
  $check_a04 = 0;
  $check_a05 = 0;
  $check_a06 = 0;
  $check_a07 = 0;
  $check_a08 = 0;
  $check_a09 = 0;
  $check_a10 = 1;
  </code></pre>
  
  <p><em>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</em></p>