Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将我的 SQL 数据库转换为 MYSQL,并且在 mysql 中使用 cast 时遇到问题,请帮我将此 SQL 查询转换为 mysql
这里 col1 是 varchar 的类型(存储值(01,02,03,04))
select * from table1 order by cast(col1 as numeric)
尝试改用数据类型SIGNED:
SIGNED
select * from table1 order by cast(col1 as SIGNED)