【问题标题】:mysql select from multiple table with functionmysql从具有功能的多个表中选择
【发布时间】:2017-06-19 06:51:38
【问题描述】:

这个查询有什么问题

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 - 函数报告.SUM 不存在。检查参考手册中的“函数名称解析和解析”部分

【问题讨论】:

  • 你只能这样称呼SELECT SUM(reports.time1) ...

标签: mysql


【解决方案1】:

应该是……

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-30
    • 1970-01-01
    • 1970-01-01
    • 2010-10-01
    • 1970-01-01
    相关资源
    最近更新 更多