Here is something I did not know: apparently, the ‘by’ in ‘group by’ is optional.
The following job compiles just fine, and outputs the correct result:
static void KlForGroupBy(Args _args)
{
InventTable inventTable;
;
while select inventTable
group by ItemGroupId
{
info(inventTable.ItemGroupId);
}
info('------');
while select inventTable
group ItemGroupId // without by
{
info(inventTable.ItemGroupId);
}
}
{
InventTable inventTable;
;
while select inventTable
group by ItemGroupId
{
info(inventTable.ItemGroupId);
}
info('------');
while select inventTable
group ItemGroupId // without by
{
info(inventTable.ItemGroupId);
}
}
It looks funny though :-).