如何通过逻辑订购买家编号获得订单?
查询:
SELECT * FROM $auction_id ORDER BY buyer_num
结果:
> 1 2 23 3 32 4 5 6 62 7 8 9 10
我需要输出的结果:
> 1 2 3 4 5 6 7 8 9 10 23 32 62
答案 0 :(得分:0)
看起来您已将buyer_num
定义为字符串而不是整数。如果你想把它排序好像是一个数字,你可以说
ORDER BY CONVERT(buyer_num, SIGNED INTEGER)
https://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_convert