我正在尝试为饼图制作一个SQL语句
我需要饼图链接到此表中名为'students'的表我有一个名为APPLICANT_ACCEPTED的列,其中包含值'Y'或'N'我需要饼图来显示所有'Y'值和'N'值。
任何人都可以提供帮助吗?
由于
答案 0 :(得分:0)
使用任意数据集的示例查询。请努力提供有关您将来所做或尝试过的更多信息和信息。一点点搜索工作都会有很长的路要走!
WITH dataset AS (
SELECT 'a' applicant_name, 'N' applicant_accepted FROM dual
UNION ALL
SELECT 'b', 'Y' FROM dual
UNION ALL
SELECT 'c', 'N' FROM dual
UNION ALL
SELECT 'd', 'Y' FROM dual
UNION ALL
SELECT 'e', 'N' FROM dual
UNION ALL
SELECT 'f', 'N' FROM dual
)
SELECT NULL link, 'Accepted' label, count(case applicant_accepted when 'Y' then 1 end) value
FROM dataset
UNION ALL
SELECT NULL, 'Rejected', count(case applicant_accepted when 'N' then 1 end)
FROM dataset