mysql从多个表中选择函数

时间:2017-06-19 06:51:39

标签: mysql

这个查询的prublem是什么

select reports.SUM( time1 ),
reports.created_by,
reports.id,
users.wage,
users.title
from reports,
users
where users.title = reports.created_by
and reports.created_date >= '1396/03/01'
and reports.created_date <= '1396/03/30'
GROUP BY created_by
ORDER BY created_by

1630 - FUNCTION reports.SUM不存在。检查&#39;功能名称解析和解决方案&#39;参考手册

中的部分

1 个答案:

答案 0 :(得分:0)

应该是......

select SUM(reports.time1),
reports.created_by,
reports.id,
users.wage,
users.title
from reports,
users
where users.title = reports.created_by
and reports.created_date >= '1396/03/01'
and reports.created_date <= '1396/03/30'
GROUP BY created_by
ORDER BY created_by