Retrieval using user-defined aggregate (UDA) functions
Using the SELECT command to return data and apply user-defined aggregate functions.
Referring back to the user-defined aggregate average(), retrieve the average of the column cyclist_time_sec from a table.
Procedure
-
List all the data in the table.
cqlsh> SELECT * FROM cycling.team_average;
-
Apply the user-defined aggregate function
average()
to the cyclist_time_sec column.cqlsh> SELECT average(cyclist_time_sec) FROM cycling.team_average WHERE team_name='UnitedHealthCare Pro Cycling Womens Team' AND race_title='Amgen Tour of California Women''s Race presented by SRAM - Stage 1 - Lake Tahoe > Lake Tahoe';