--cast(字段名 AS 新类型) --convert(新类型,字段名) Order By Cast(A As Int) Desc Order By Convert(Int, A) Desc
在mysql中不能用阿 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Int,re) desc' at line 1 SELECT * FROM myexamples.article where catalog="60" order by convert(Int,a) desc;
我试出来了 select * from tb ORDER BY right('00000'+a,5) desc就可以解决问题
select * from tb ORDER BY right('00000'+a,5) desc是什么意思呀?
ORDER BY right('00000'+a,5) desc
--convert(新类型,字段名)
Order By Cast(A As Int) Desc
Order By Convert(Int, A) Desc
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Int,re) desc' at line 1
SELECT * FROM myexamples.article where catalog="60" order by convert(Int,a) desc;
select * from tb
ORDER BY right('00000'+a,5) desc就可以解决问题
ORDER BY right('00000'+a,5) desc是什么意思呀?