擅长:python、mysql、java
<p>你总是可以这样<code>ORDER BY</code>:</p>
<pre><code>select
title,
( stock_one + stock_two ) as global_stock
from product
order by 2, 1
</code></pre>
<p>或者将其包装在另一个选择中:</p>
<pre><code>SELECT *
from
(
select
title,
( stock_one + stock_two ) as global_stock
from product
) x
order by (case when global_stock = 0 then 1 else 0 end) desc, title
</code></pre>