Sql 元数据库-字段筛选器作为文本
我有一个SQL查询:Sql 元数据库-字段筛选器作为文本,sql,postgresql,data-visualization,metabase,Sql,Postgresql,Data Visualization,Metabase,我有一个SQL查询: select concept, count(*) from annotation where exists (select 1 from annotation a2 where a2.comment_commentid = annotation.comment_commentid and a2.concept = 'Fatigue' ) group by concept; 我想用{{word
select concept, count(*)
from annotation
where exists (select 1
from annotation a2
where a2.comment_commentid = annotation.comment_commentid and a2.concept = 'Fatigue'
)
group by concept;
我想用{{word}}替换“Fatigue”,做一个过滤器小部件,从数据库映射到列。
我有以下错误:
错误:位置:307处或附近的语法错误
我需要更改什么以应用过滤器?从该列中选择可用的单词?
使用变量类型作为文本,它可以工作。。。但不要像变量类型字段过滤器那样在过滤器中显示所有可用选项
谢谢 外部注释表也需要别名。当有疑问时,在解析名称时,内部范围始终占优势,并且内部范围存在。。。在范围中查询注释名称
[错误的原因可能是中间件混淆了]
不处理sql问题。。。给出此错误:错误:对表注释的FROM子句项的引用无效提示:可能您想引用表别名a1。位置:221或者您想引用表别名a1。
select concept, count(*)
from annotation a1 -- <<-- HERE!
where exists (select 1
from annotation a2
where a2.comment_commentid = a1.comment_commentid and a2.concept = 'Fatigue'
)
group by concept;