SELECT
issues.id,
severity as criticality,
IFNULL(rules.name, plugin_rule_key) as name,
message,
projects.name,
projects.kee,
projects.long_name,
line,
rules.plugin_rule_key,
rules.plugin_name
FROM issues
LEFT OUTER JOIN projects ON projects.id = issues.component_id
LEFT OUTER JOIN rules ON rules.id = issues.rule_id
WHERE
issues.status = 'OPEN'
AND projects.enabled = 1
AND issues.root_component_id = XXXXXX
其中XXXXXX是我要导出的感兴趣项目的数字ID。 现在我们转移到SonarQube 5.6和上面的查询不再工作。 数据库与以前的版本有点不同,我尝试以这种方式修改查询:
SELECT
issues.id,
severity as criticality,
IFNULL(rules.name, plugin_rule_key) as name,
message,
projects.name,
projects.kee,
projects.long_name,
line,
rules.plugin_rule_key,
rules.plugin_name
FROM issues
INNER JOIN projects ON projects.project_uuid = issues.project_uuid
INNER JOIN rules ON rules.id = issues.rule_id
WHERE
issues.status = 'OPEN'
AND projects.enabled = 1
AND projects.root_id = XXXXXX
--AND issues.project_uuid = 'XyzWXyzWXyzWXyzWXyzW'
查询不起作用,sql客户端内存不足...尝试使用相同的rusults过滤issues.project_uuid。 我需要这种导出,因为我然后创建一个带有一些数据透视表和计算的Excel工作表。 5.6版的正确查询是什么? 提前谢谢。
答案 0 :(得分:0)
我找到了将问题表加入相关项目的正确方法。 现在这是与SonarQube 5.6 mySql数据库完美配合的正确查询:
wrap_content