$this->db->get('t_account')
我在用CI操作数据库时报以下错误,有人知道怎么解决吗?A Database Error Occurred
Error Number: 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 'FROM (`t_account`) WHERE `userId` = '10001' GROUP BY `type`' at line 2
SELECT date_format(createTime, `'%x')` as year, date_format(createTime, `'%v')` as week, SUM(`money`) AS money FROM (`t_account`) WHERE `userId` = '10001' GROUP BY `type`
Filename: /data/home/jd/Project/JdManager/server/models/maccount/account_model.php
Line Number: 136
請貼上第 136 行那個區塊的方法全代碼
並附註你注入的參數為何 使用了group by以后,createTime就不能用了吧?只能使用group by 里的字段和聚类函数,比如sum求和,avg求平均值,count求计数这些。 :lol:lol:lol:lol:lol
页:
[1]