我想問一下如何在for each
語句中使用多個break。在多個字段中使用Break By
樣品:
Car Code Color Code
0001 002
0001 002
0001 001
0005 003
0005 002
0007 001
0008 001
0008 005
0008 001
我的代碼是:
def var ctr as int.
對於每一車沒鎖打破由carcode通過的ColorCode。
ctr = ctr + 1.
/*I tried*/
if last-of(carcode) and last-of(colorcode) then do:
disp carcode colorcode ctr.
ctr = 0.
end.
/*and tried*/
last-of(colorcode) then do:
if last-of(carcode)
disp carcode colorcode ctr.
ctr = 0.
end.
end.
end.
我的預期輸出是:
car code Color Code QTY
0001 001 1
0001 002 2
0005 002 1
0005 003 1
0007 001 1
0008 001 2
0008 005 1
你在說什麼語言? SQL?另外,這個問題不是很清楚。你想用相同的汽車代碼和顏色代碼來統計行嗎? –
我正在使用進度4gl /打開抱歉不澄清。我想要的是顯示汽車代碼的總數量與其相應的顏色。 – noob