I have a select similar to the one below:
SELECT DISTINCT
SCARR~CARRID,
SCARR~CARRNAME,
MIN( SPFLI~DISTANCE ) AS MIN_DISTANCE
FROM SCARR JOIN SPFLI ON SPFLI~CARRid = SCARR~CARRid
GROUP BY
SCARR~CARRID,
SCARR~CARRNAME
INTO TABLE @DATA(result).
In the real case, these are other tables and I have many more fields in both SELECT
and GROUP BY
.
Can I simplify the GROUP BY
to not have to write again all the fields that are in the SELECT
clause from the table SCARR
?
I know other options are to use MIN
for all the fields of table SCARR
except its ID, or not GROUP BY
and instead remove duplicates after the select, but I was trying to do something like GROUP BY scarr~*