- 论坛徽章:
- 1
|
select DATE_FORMAT(b.ACTUAL_TIME,'%Y') as 年度,
b.PAYMENT_DAYS as 月份,
b.PAY_MONEY as this_month,
(select a.pay_money from tc_power_pay a where DATE_FORMAT(a.ACTUAL_TIME,'%Y')=2015 and
a.payment_days=02 and a.BASE_STATION_ID=b.BASE_STATION_ID) as last_month,
CONCAT((FORMAT(this_month /last_month) /last_month * 100,2), "%") as 环比率
from tc_power_pay b
where DATE_FORMAT(b.ACTUAL_TIME,'%Y')=2015 and b.PAYMENT_DAYS=03 ORDER BY b.POWER_PAY_ID
用了你写的这行环比的sql语句,数据库执行的时候还是出现了报错,如下:
[Err] 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 ') /last_month * 100,2), "%") as 环比率
from tc_power_pay b
where DATE_FORMA' at line 6
请问这是什么报错?
|
|