201802050001-10
201802050001-9
201802050001-8
SELECT trade_no from orders where trade_no like '201802050001-%' order by trade_no desc
结果
201802050001-9
201802050001-8
201802050001-10
不符合预期
解决办法
SELECT trade_no from orders where trade_no like '201802050001-%' order by replace(trade_no,'-','')+0 desc
结果
201802050001-10
201802050001-9
201802050001-8
符合预期