REPORT zdemo02.
CLASS cls DEFINITION.
PUBLIC SECTION.
CLASS-METHODS meth.
ENDCLASS.
CLASS cls IMPLEMENTATION.
METHOD meth.
WITH +aggregates AS (
SELECT FROM sflight
FIELDS carrid,
connid,
'MAX' AS function,
MAX( CAST( seatsocc AS DEC( 31,2 ) ) ) AS agg
GROUP BY carrid, connid
UNION
SELECT FROM sflight
FIELDS carrid,
connid,
'MIN' AS function,
MIN( CAST( seatsocc AS DEC( 31,2 ) ) ) AS agg
GROUP BY carrid, connid
UNION
SELECT FROM sflight
FIELDS carrid,
connid, 'AVG' AS function,
AVG( seatsocc AS DEC( 31,2 ) ) AS agg
GROUP BY carrid, connid
)
SELECT *
FROM +aggregates
WHERE carrid = 'LH' AND connid = '0400'
INTO TABLE @DATA(result).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
cls=>meth( ).
阅读(1394) | 评论(0) | 转发(0) |