oracle引用外层表名出错误,详细如下
select *from (select region_id,(SELECT count(1) FROM (SELECT ehr_id FROM Ehr_Maternal_Health t1 WHERE enable_flag=1 AND to_number(to_char(visit_date,'yyyy'))=2013AND EXISTS (SELECT 1 FROM ehr_info WHERE ehr_id=t1.ehr_id AND region_id=t.parent_id AND town_id=t.region_id AND visit_level<3) GROUP BY ehr_id HAVING count(1)>=5) c) number, from table t)提示在EXISTS (SELECT 1 FROM ehr_info WHERE ehr_id=t1.ehr_id AND region_id=t.parent_id AND town_id=t.region_id AND visit_level<3)找不到t.region_id和t.parent_id标示符。我怎么怎么处理?
[解决办法]
发现nunber后面多了个‘,’号,还有这个写法也太复杂了吧,采取关联的写法不行么