对聚合函数的一些帮助
我正在尝试使用 php 创建动态表,但需要让下面的查询正常工作,但遇到了我在查询下面给出的错误。我需要一些帮助来修复它。
SELECT test_case_name AS 'Test Case',
AVG( no_of_satelites ) AS 'Mean Number of Satelites',
AVG( hdop ) AS 'Mean of HDOP',
AVG( longitude ) AS 'Mean of Longitude',
STD( AVG( longitude ) ) AS 'StdDev of Longitude',
AVG( latitude ) AS 'Mean of Latitude',
STD( AVG( latitude ) ) AS 'StdDev of Latitude',
( 1.114 * pow( 10, 5 ) * STD( AVG( latitude ) ) ),
( 1.114 * pow( 10, 5 ) * STD( AVG( longitude ) ) )
FROM test_cases, gga_raw_data
WHERE gga_raw_data.test_case_id = test_cases.test_case_id
GROUP BY test_case_name
错误显示:
1111 - 组功能使用无效
任何建议或线索将不胜感激。
I am trying to create a dynamic table using php but needed to get the query below to work normaly but am experiencing an error which I have given below the query. I need some help to fix it.
SELECT test_case_name AS 'Test Case',
AVG( no_of_satelites ) AS 'Mean Number of Satelites',
AVG( hdop ) AS 'Mean of HDOP',
AVG( longitude ) AS 'Mean of Longitude',
STD( AVG( longitude ) ) AS 'StdDev of Longitude',
AVG( latitude ) AS 'Mean of Latitude',
STD( AVG( latitude ) ) AS 'StdDev of Latitude',
( 1.114 * pow( 10, 5 ) * STD( AVG( latitude ) ) ),
( 1.114 * pow( 10, 5 ) * STD( AVG( longitude ) ) )
FROM test_cases, gga_raw_data
WHERE gga_raw_data.test_case_id = test_cases.test_case_id
GROUP BY test_case_name
The error says:
1111 - Invalid use of group function
Any suggestion or clues would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
左括号太多。左括号比右括号多 2 个。
这是不平衡的查询部分:
Too many left parentheses. You have 2 more left parentheses than right parentheses.
This is the piece of the query that is imbalanced:
您必须拥有 GROUP BY 子句中列出的 SELECT 子句中的所有非聚合列:
you have to have all non-aggregate columns from the SELECT clause listed in the GROUP BY clause: