- the begin
/* Select count (*)
Into count1
The From (select Arthur c. hannelitemid, Arthur c. hannelid From regentd. The channel where c
C.N ame like (' % (closed) % ') or c.N ame like (' % (closed) % ')
And Arthur c. hannelitemid='5 b3bd6900e834cbbbb443ea2fb8872c1 or Arthur c. hannelitemid=' 8 b1dc268c6bc466bb73f083d14b46eef '
B and c.i ncomecustomer is null)
Left the Join regentd. Channelitemlist ct On biggest hannelitemid=ct. Id.
*/
- whi ` le count1 & gt; 0
- loop
Insert into regentd. Couponschannelsheet (
Guid, channelid)
The Select v_coupon_id, biggest hannelid
- into v_channelid
The From (select Arthur c. hannelitemid, Arthur c. hannelid From regentd. The channel where c
C.N ame like (' % (closed) % ') or c.N ame like (' % (closed) % ')
And Arthur c. hannelitemid='5 b3bd6900e834cbbbb443ea2fb8872c1 or Arthur c. hannelitemid=' 8 b1dc268c6bc466bb73f083d14b46eef '
B and c.i ncomecustomer is null)
Left the Join regentd. Channelitemlist ct On biggest hannelitemid=ct. Id.
- values (v_coupon_id v_channelid);
- count1:=count1-1;
- end loop;
- end;
First found out biggest hannelid (multiple rows of data), v_coupon_id (data line), their relationship is a relationship, I want the result is below
CodePudding user response:
Is there any other code?CodePudding user response:
Insert into regentd. Couponschannelsheet
(guid, channelid)
The Select v_coupon_id, biggest hannelid
- into v_channelid
The From (select Arthur c. hannelitemid, Arthur c. hannelid
The from regentd. Channel c
Where c.N ame like (' % (closed) % ')
The or c.n ame like (' % (closed) % ')
And Arthur c. hannelitemid='5 b3bd6900e834cbbbb443ea2fb8872c1'
The or Arthur c. hannelitemid='8 b1dc268c6bc466bb73f083d14b46eef'
B and c.i ncomecustomer is null)
Left the Join regentd. Channelitemlist ct
On biggest hannelitemid=ct. Id;
- values (v_coupon_id v_channelid);
Effective statements in figure, won't appear the error, in the process, there are other statements,
CodePudding user response:
The results found out direct cartesian set,For example:
The select a.c 1, the biggest 1 from a, b;