【问题标题】:Error 1052: Column 'metric_name' in where clause is ambiguous错误 1052:where 子句中的列 'metric_name' 不明确
【发布时间】:2018-01-19 08:16:12
【问题描述】:
SELECT b.target_host                              AS 'host',
       a.target_ip                                AS 'Target',
       a.monitor_type                             AS 'Type Monitor',
       Concat (a.metric_name, "", a.metric_value) AS "metric name value"
FROM   pm_sis_raw_metrics AS a
       INNER JOIN pm_sis_hs_metrics AS b
               ON a.id = b.id
WHERE  metric_value > 80
       AND ( metric_name = "utilization"
              OR metric_name = "physical memory used %"
              OR metric_name = "disk/file system/[c]/percent full"
              OR metric_name = "% packets good" )  

错误 1052:where 子句中的列“metric_name”不明确

【问题讨论】:

标签: mysql sql grafana mysql-error-1052


【解决方案1】:

您必须在 where cause 中使用列名(如 a.metric_name)指定表别名。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-10-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-13
    相关资源
    最近更新 更多