SELECT loop. The
clause used here cannot be written to a tabular result, which means that, in multirow results sets, a loop is opened that must be closed using
SELECT carrid, connid, SUM( seatsocc ) AS seatsocc FROM sflight GROUP BY carrid, connid ORDER BY carrid, connid INTO (@DATA(carrid),@DATA(connid),@DATA(seatsocc)). ... ENDSELECT.