MySQL count multiple columns and sum the total occurrence
This is a query with an idea like in MySQL count multiple columns and sum the total occurrence

SELECT 
drawno, 
SUM(CASE WHEN FIRST = 0 THEN 1 ELSE 0 END) zero,
SUM(CASE WHEN FIRST = 1 THEN 1 ELSE 0 END) one,
SUM(CASE WHEN FIRST = 2 THEN 1 ELSE 0 END) two,
SUM(CASE WHEN FIRST = 3 THEN 1 ELSE 0 END) three,
SUM(CASE WHEN FIRST = 4 THEN 1 ELSE 0 END) four,
SUM(CASE WHEN FIRST = 5 THEN 1 ELSE 0 END) five,
SUM(CASE WHEN FIRST = 6 THEN 1 ELSE 0 END) six,
SUM(CASE WHEN FIRST = 7 THEN 1 ELSE 0 END) seven,
SUM(CASE WHEN FIRST = 8 THEN 1 ELSE 0 END) eight,
SUM(CASE WHEN FIRST = 9 THEN 1 ELSE 0 END) nine
FROM 
(
  SELECT 
    first
    ,drawno 
  FROM table1 
  UNION ALL 
  SELECT 
     second
     ,drawno 
  FROM table1 
  UNION ALL 
  SELECT 
    third
    ,drawno 
  FROM table1 
  UNION ALL 
  SELECT 
    fourth
    ,drawno 
  FROM table1
) AS t GROUP BY drawno;


Two queries, this and from first answer:
http://sqlfiddle.com/#!2/2eb93d/2