delete from TE_GOUPMEMBER a
where
AGGREGATENO
not in
( select AGGREGATENO from TEMP_TE_GOUPMEMBER)
and
CUSTOMERID
not in
(select CUSTOMERID from TEMP_TE_GOUPMEMBER)
;
你这条SQL在Informix中通不过,继续,
谢谢!
let s_jgbh=s_jgbh + "%"
select IDORGAN,SORGANNAMEB
from TB2_ORGAN
where IDORGAN LIKE s_jgdh;
呵呵,谢谢!再问一个
delete from TE_GOUPMEMBER a
where not (((a.AGGREGATENO,a.CUSTOMERID)
in (select AGGREGATENO,CUSTOMERID from TEMP_TE_GOUPMEMBER))
);
应是要删除表TE_GOUPMEMBER 在表TEMP_TE_GOUPMEMBER中存在的记录,上面SQL语句竟通不过,哪位有好招!
不知你看的是什么标准的SQL??
其实这个很简单
delete from TE_GOUPMEMBER a
where
AGGREGATENO
not in
( select AGGREGATENO from TEMP_TE_GOUPMEMBER)
and
CUSTOMERID
not in
(select AGGREGATENO,CUSTOMERID from TEMP_TE_GOUPMEMBER)
;
你要换个思路:
想办法凑个i_length长的变量s_jgdh
象i_length=4,IDORGAN总长为10,则s_jgbh="XXXX??????"
select改成:
select IDORGAN,SORGANNAMEB
from TB2_ORGAN
where IDORGAN LIKE s_jgdh;