oracle执行sql查询语句出现错误ORA-00942:表或视图不存在
情况是这样,A库的用户名和表空间分别为SH , SH
把业务表SH所有数据从A库,导入到B库, 表空间为SH,用户名为SP
在B库里面执行sql查询语句出现错误ORA-00942:表或视图不存在
语句为: 这里看出是因为用户变的原因,所以程序端需要进行用户变更
select sum(temp.lrs) from (select sum(a.lrs) lrs from (select count(distinct f.r026) crs from sh.fb01 f where f.f002 = 1 and f.f004 = 1 and f.if_big_donation = '0' and exists (select 1 from sh.c01 c where c.r001 = f.r001 and c.ownership = '1') group by r001) a union all select count(distinct x.r026) ljzcrs from sh.fb01 x where q002 = 1 and r001 in (select b.r001 from sh.f01 a, sh.fc02 b where a.r001 = b.acr001 and a.r012 = '1' and a.r011 = '0' and b.aaa110 = '2' and a.ownership = '2') and x.if_big_donation = '0') temp
业务语句不用管,重点是sh用户
修正语句为: 表名前缀换成sp
select sum(temp.lrs) from (select sum(a.ljzcrs) lrs from (select count(distinct f.acr026) lrs from sp.fb01 f where f.f002 = 1 and f.f004 = 1 and f.if_big_donation = '0' and exists (select 1 from sp.c01 c where c.r001 = f.r001 and c.ownership = '1') group by acr001) a union all select count(distinct x.r026) ljzcrs from sp.b01 x where q002 = 1 and acr001 in (select b.acr001 from sp.f01 a,sp.c02 b where a.r001 = b.r001 and a.r012 = '1' and a.r011 = '0' and b.aaa110 = '2' and a.ownership = '2') and x.if_big_donation = '0') temp
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?