title: MySQL how to SELECT FROM two distinct Sub Set within Same condition range and Order by a Case condition
body: <p>I have real world mysql select problem with my website, I have members who's gender is either female or male, But they are not proportionally distributed, i.e 70% male, 30% female, </p>
  
  <p>I want to do Select to the Display in my home page of the website, where </p>
  
  <ol>
  <li>Select Random 50 members BUT make sure they are 50% male and 50% female</li>
  <li>Order these results where male then female, next one male female, i.e m,f,m,f...etc</li>
  </ol>
  
  <p>How do i achieve this via a Single Query ?</p>
  
  <p>ex:</p>
  
  <pre><code>SELECT * FROM user u WHERE 1 ORDER BY rand() LIMIT 50
  </code></pre>
  
  <p>will not select the 50% ratio, i want, so please help if you can</p>