16.20 - 饼图的示例 SQL - Teradata Ecosystem Manager

Teradata® Ecosystem Manager 用户指南

prodname
Teradata Ecosystem Manager
vrm_release
16.20
created_date
2018 年 10 月
category
用户指南
featnum
B035-3201-107K-CHS
下面是一个示例 SQL,可用来创建一个饼图,以显示包含应用程序整体状态的报告。要显示饼图,SQL 必须将结果集限制为不超过 20 行。
SELECT st.StateName, COUNT(*) NumApplications
FROM
	( SELECT applicationId, Min(TRIM(COALESCE((CASE WHEN COALESCE(DaemonGroupAggStateCode,0) > COALESCE(DatabaseAggStateCode,0) THEN DaemonGroupAggStateCode ELSE DatabaseAggStateCode END),10)) ) AS stateCode FROM MSMApplication GROUP BY 1
) ast 
INNER JOIN 
	MSMState st ON st.StateCode=ast.StateCode
GROUP BY st.StateName
报告查看器门户组件可显示以下饼图。