mysql varchar转换为int
1.手动转化类型(直接+0)select server_id from cardserver where game_id = 1 order by server_id+0 desclimit 102.使用MySQL函数CASTselect server_id from cardserver where game_id = 1 order by CAST(server_id as S...
·
1.手动转化类型(直接+0)
select server_id from cardserver where game_id = 1 order by server_id+0 desclimit 10
2.使用MySQL函数CAST
select server_id from cardserver where game_id = 1 order by CAST(server_id as SIGNED) desc limit 10;
3.使用MySQL函数CONVERT
select server_id from cardserver where game_id = 1 order by CONVERT(server_id,SIGNED)desc limit 10;
更多推荐
已为社区贡献2条内容
所有评论(0)