我想问一下如何在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