[英]Column found in more than one table error
我收到以下错误
编译语句时出错:
失败:在多个表/子查询中发现了SemanticException列Episodeid [SQL状态= 42000,数据库错误代码= 40000]
谁能帮助我重新配置?
谢谢!
这是有问题的代码:
select
papid, count(distinct episodeid) as epicount,
episovcountcesarean, sum(episovspendcesarean),
count(claimnumber) as claimcount,
sum(allowedamount) as spend
from
3pdcoe_tc_dm_eoc_nep_peri.star_output_episodes e
join
3pdcoe_tc_dm_eoc_nep_peri.dbo_claimpatientservice cps on cps.episodeidd = e.episodeid
join
3pdcoe_tc_dm_eoc_nep_peri.star_output_aggregate a on a.episodeid = e.episodeid
where
aggtype = 'Window' and agggroup = 'Trigger'
and eeany = 0
and year(episodeend) = '2016'
and episovcountcesarean = 1
group by
papid, episovcountcesarean, episovspendcesarean;
在选择列表中,您必须指定目标表
select
papid, count(distinct a.episodeid) as epicount,
episovcountcesarean, sum(episovspendcesarean),
count(claimnumber) as claimcount,
sum(allowedamount) as spend
要么
select
papid, count(distinct e.episodeid) as epicount,
episovcountcesarean, sum(episovspendcesarean),
count(claimnumber) as claimcount,
sum(allowedamount) as spend
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.