mysql一个sql
select a*100% from a 编译错
这里 a表 a字段是float。
后来我换成select a*100 from a 还是失败如果能在sql做到 select a*100% from a (
要求结果如下 之前a=2
select a*100% from a
后得到 200%
-------------------经过sql处理后)
select a*100% from a 编译错
这里 a表 a字段是float。
后来我换成select a*100 from a 还是失败如果能在sql做到 select a*100% from a (
要求结果如下 之前a=2
select a*100% from a
后得到 200%
-------------------经过sql处理后)
mysql> select concat(2*100,'%');
+-------------------+
| concat(2*100,'%') |
+-------------------+
| 200% |
+-------------------+
1 row in set (0.00 sec)mysql>
mysql> select concat(2*100,'%') as 'limit';
+-------+
| limit |
+-------+
| 200% |
+-------+
1 row in set (0.00 sec)mysql> select concat(2*100,'%') as `limit`;
+-------+
| limit |
+-------+
| 200% |
+-------+
1 row in set (0.00 sec)mysql>