title: Assign order based on most rows are not null in mysql database
body: <p>I am generating all combinations for variables and insert into temp table</p>
  <pre><code>select *
  from (select 33 as age union all select null) a cross join
       (select 44 as totaldd union all select null) t cross join
       (select 30 as timeperiod union all select null) d cross join
       (select CURDATE() as StartDateTime union all select null) s
  </code></pre>
  <p>Results are:</p>
  <p><a href="https://i.stack.imgur.com/ZdYyR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZdYyR.png" alt="enter image description here" /></a></p>
  <p>I want order based on most rows are not null Like</p>
  <p><a href="https://i.stack.imgur.com/N7MNU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N7MNU.png" alt="enter image description here" /></a></p>