SELECT "public"."mv_tags_per_org"."count" AS "count", "public"."mv_tags_per_org"."tag_name" AS "Tag Name",
CASE
WHEN "public"."mv_tags_per_org"."ngo_id" = 30 then 'SSS'
WHEN "public"."mv_tags_per_org"."ngo_id" = 33 then 'PF'
WHEN "public"."mv_tags_per_org"."ngo_id" = 34 then 'DS'
ELSE 'Maybe'
END AS "NPO"
FROM "public"."mv_tags_per_org"
WHERE "NPO???" = "SSS"
上面你可以看到我的代码。当您删除“WHERE”功能时,它当前正在返回我想要的输出。我正在添加“WHERE”函数并尝试访问我创建的名为“NPO”的新列。在 SQL 编辑器中似乎该列不存在,但在运行查询时它确实存在。我如何访问它?
谢谢!