找不到表 好象就是这句 where ORG.CODE_T_S=H.CODE_T_S and ORG.COP_EMS_NO = strORG_COP_EMS_NO ) O on 是不是有错误呢
substring 好像不可以用把,改为:substr
还有:I.G_NAME=O.G_NAME I是哪一个表阿?你看看是不是这样: select substr(t1.CODE_T_S,0,5) CODE_T_S, t1.G_NAME, t1.NOTE_S from (select COP_EMS_NO,G_NO,CODE_T_S,G_NAME from tablename where COP_EMS_NO= strCOP_EMS_NO ) t2 right join (select distinct H.CODE_T_S,H.G_NAME,H.NOTE_S from tablename ORG,TC_COMPLEX H where ORG.CODE_T_S=H.CODE_T_S and ORG.COP_EMS_NO = strORG_COP_EMS_NO ) t1 on t1.CODE_T_S=substring(t2.CODE_T_S,0,5) and t1.G_NAME=t2.G_NAME where t1.CODE_T_S is null";
I.CODE_T_S=substring(O.CODE_T_S,0,5) and I.G_NAME=O.G_NAME where I.CODE_T_S is null"; 这里好像没有指定别名为I的表 是不是right join前面忘了加了
I.CODE_T_S=substring(O.CODE_T_S,0,5) and I.G_NAME=O.G_NAME where I.CODE_T_S is null"; 这里好像没有指定别名为I的表还有,你用的是9i?为什么要用新的1999标准sql?
好象就是这句
where ORG.CODE_T_S=H.CODE_T_S and ORG.COP_EMS_NO = strORG_COP_EMS_NO ) O on
是不是有错误呢
I是哪一个表阿?你看看是不是这样:
select substr(t1.CODE_T_S,0,5) CODE_T_S, t1.G_NAME, t1.NOTE_S from
(select COP_EMS_NO,G_NO,CODE_T_S,G_NAME
from tablename
where COP_EMS_NO= strCOP_EMS_NO ) t2
right join
(select distinct H.CODE_T_S,H.G_NAME,H.NOTE_S
from tablename ORG,TC_COMPLEX H
where ORG.CODE_T_S=H.CODE_T_S and ORG.COP_EMS_NO = strORG_COP_EMS_NO ) t1
on t1.CODE_T_S=substring(t2.CODE_T_S,0,5) and t1.G_NAME=t2.G_NAME
where t1.CODE_T_S is null";
where I.CODE_T_S is null";
这里好像没有指定别名为I的表
是不是right join前面忘了加了
where I.CODE_T_S is null";
这里好像没有指定别名为I的表还有,你用的是9i?为什么要用新的1999标准sql?