我尝试将整数/十进制值转换为Float,但它返回语法错误。我使用了以下示例查询。
SELECT cast(order_quantity as float) t FROM demo limit 10
它返回了以下错误。
Error Code: 1064. 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 'float) FROM demo limit 10' at line 1
那么有没有办法在memsql中强制转换?
提前谢谢。
答案 0 :(得分:1)
强制转换为浮动。此处列出了受支持的演员阵容:
CAST (input AS {BINARY | CHAR | DATE | DATETIME[(prec)] | DECIMAL[(prec [, scale])] | TIME[(prec)] | SIGNED [INTEGER] | UNSIGNED [INTEGER]})
http://docs.memsql.com/v5.7/docs/convert
十进制演员会有效吗?