【发布时间】:2011-11-07 14:16:23
【问题描述】:
我有一个数据库,其中包含我的在线网店的所有交易,我正在尝试进行查询以打印出一份简单的财务报表。
它将打印在这样的表格中:
<th>month</th>
<th>number of sales</th>
<th>money in</th>
<th>money out</th>
<th>result</th>
查询失败:#1111 - 无效使用组函数
SELECT
month(transaction_date) as month,
count(incoming_amount > '0') as number_of_sales,
sum(incoming_amount / 1.25) as money_in,
sum(outgoing_amount) as money_out,
sum((incoming_amount / 1.25) - sum(outgoing_amount)) as result
FROM myDB WHERE year(timestamp) = '2011' order by id desc");
谁能指出我正确的方向?
【问题讨论】:
-
你真的有一个叫
myDB的表吗?
标签: mysql sql mysql-error-1111