select location, age, avg(income), min(income), max(income) from Person group by location, age //SQL
acc( $p : Person();
[$l, $a] : distinct( $p.location, $p.age) )
acc( $p : Person( location == $l, age == $a );
$avgIncome : avg( $p.income ) ,
$minIncome : min( $p.income ),
$maxIncome : max( $p.income ) )
If we wanted to make a list of lists we could add:
acc( $l : List() from [$avgIncome, $minIncome, $maxIncome],
list( $l )
Can some give me specific example with this