
-- begin
/*Select count(*)
into count1
From (select c.Channelitemid,c.Channelid from regentd.channel c where
c.Name like('%(閉)%') or c.name like ('%(閉)%')
and c.Channelitemid ='5B3BD6900E834CBBBB443EA2FB8872C1' or c.Channelitemid ='8B1DC268C6BC466BB73F083D14B46EEF'
and c.incomecustomer is null) b
left Join regentd.Channelitemlist ct On b.Channelitemid =ct.Id;
*/
--- whi`le count1>0
-- loop
insert into regentd.couponschannelsheet(
guid,channelid)
Select v_coupon_id,b.Channelid
--into v_channelid
From (select c.Channelitemid,c.Channelid from regentd.channel c where
c.Name like('%(閉)%') or c.name like ('%(閉)%')
and c.Channelitemid ='5B3BD6900E834CBBBB443EA2FB8872C1' or c.Channelitemid ='8B1DC268C6BC466BB73F083D14B46EEF'
and c.incomecustomer is null) b
left Join regentd.Channelitemlist ct On b.Channelitemid =ct.Id;
--values(v_coupon_id,v_channelid);
--count1 := count1-1;
--end loop;
--end;
首先查出來b.Channelid(多行資料),v_coupon_id(單行資料),他們的關系是一對的關系,我想要的結果是如下圖
uj5u.com熱心網友回復:
還有別的代碼嗎?uj5u.com熱心網友回復:
insert into regentd.couponschannelsheet
(guid, channelid)
Select v_coupon_id, b.Channelid
--into v_channelid
From (select c.Channelitemid, c.Channelid
from regentd.channel c
where c.Name like ('%(閉)%')
or c.name like ('%(閉)%')
and c.Channelitemid = '5B3BD6900E834CBBBB443EA2FB8872C1'
or c.Channelitemid = '8B1DC268C6BC466BB73F083D14B46EEF'
and c.incomecustomer is null) b
left Join regentd.Channelitemlist ct
On b.Channelitemid = ct.Id;
--values(v_coupon_id,v_channelid);
圖中有效陳述句,不會出現這個錯誤。程序中,還有其他的陳述句吧。
uj5u.com熱心網友回復:
把結果查出來直接笛卡爾集。例如:
select a.c1,b.c1 from a,b;
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/66561.html
標籤:高級技術
