title: Ordering with Group Concat with Union not coming properly
body: <p>I am unable to sortout the result as i want it.  </p>
  
  <p>The query : </p>
  
  <pre><code>SELECT b.bid,REPLACE(GROUP_CONCAT(f.val), ',' , '')
  FROM boxes as b
  JOIN boxgroupstype as g ON (b.bgid = g.bgid AND g.btid =3)
  JOIN pages as p ON (p.pid = b.pid AND p.qid = '1')
  LEFT JOIN formboxverifychar as f ON (f.bid = b.bid AND f.fid = 66)
  WHERE val IS NOT NULL AND vid !=0
  GROUP BY varname
  UNION
  SELECT b.bid,b.label
  FROM boxes as b
  JOIN boxgroupstype as g ON (b.bgid = g.bgid AND g.btid =1)
  JOIN pages as p ON (p.pid = b.pid AND p.qid = '1' or p.qid = '2')
  LEFT JOIN formboxverifychar as f ON (f.bid = b.bid AND f.fid = 66)
  WHERE val IS NOT NULL AND vid !=0
  ORDER BY bid asc
  </code></pre>
  
  <p>so the ordering is not coming according to BID in the upper values in which g.btid =3.</p>
  
  <p>The result :</p>
  
  <blockquote>
    <p>bid   REPLACE(GROUP_CONCAT(f.val), ',' , '')<br>
      1 They are not useful<br>
      5 They are useful<br>
      7 Not at all<br>
      12    A little<br>
      15    Not at all<br>
      19    AYNTHON<br>
      43    HO<br>
      68    Yes<br>
      71    TAJLAIYPNAEG<br>
      95    35<br>
      98    Yes<br>
      100   HINESCE<br>
      123   Male    </p>
  </blockquote>
  
  <p>it should be  </p>
  
  <blockquote>
    <p>19 ANTHONY<br>
       71 PETALING JAYA<br>
      100 CHINESE  </p>
  </blockquote>
  
  <p>If anybody can help,i would appreciate it much..</p>