mysql field type is not an integer of scheduling problems

Today, I want to extract data in ascending order of weight database, the data is not found out of order row, after examination by the discovery that saved mysql character type is varchar, but the value is an integer, the solution: the sort field +0;

SELECT * FROM user ORDER BY sort+0 ASC;

ThinkPHP5:orderRaw('sort+0 asc')

Guess you like

Origin www.cnblogs.com/wheats/p/11240080.html