title: MySql sorting values from highest to lowest except zero with group by
body: <p>Here is my query </p>
  
  <pre><code>SELECT name, price, MIN(price) AS minprice 
  FROM c, cp 
  WHERE c.id = cp.id 
  GROUP BY id 
  ORDER BY minprice = 0, minprice ASC
  </code></pre>
  
  <p>But the error show me 'Reference minprice not supported (reference to group function)'. </p>
  
  <p>Anyone can help me solve this problem?</p>
  
  <p>I am facing another problem, hope your expert can give me idea how to solve it</p>
  
  <p>For Example:</p>
  
  <pre><code>id  name         price
   1     apple          0
   1     green apple    20
   2     orange         10
   3     strawberry     0
  </code></pre>
  
  <p>As the data result above the minprice of the group 1 is 0 But I don't want the min price take zero, but this is incorrenct if I give condition minprice > 0 cause</p>
  
  <p>I wanna my result become like this</p>
  
  <pre><code>2  orange         10 
  1  green apple    20
  3  strawberry      0
  </code></pre>
  
  <p>Is it possible?</p>
  
  <p>Thanks in advance.</p>