# Grand Aggregate C Maximum and Minimum Functions

> The C `mco_seq_agg_max_TYPE()`, `mco_seq_agg_min_TYPE()` and `mco_seq_agg_min_max_TYPE()` functions extract the maximum and minimum values for the input sequence.

> ## Example

> Following is an example code snippet demonstrating these functions:

>         void grand_aggregate(mco_db_h db)
>         {
>             mco_trans_h trans;
>             mco_cursor_t quote_cursor;
>             Quote quote;
>             mco_seq_iterator_t close_iterator, max_iterator, min_iterator, max_min_iterator;
>             MCO_RET rc;

>             ...
>             for (rc = mco_cursor_first(trans, &quote_cursor);
>                 rc != MCO_S_CURSOR_END;
>                 rc = mco_cursor_next(trans, &quote_cursor))
>             {
>                 Quote_from_cursor(trans, &quote_cursor, &quote);

>                 /* Initialize iterators */
>                 Quote_close_iterator(&quote, &close_iterator));

>                 /* Construct operator's pipeline */
>                 mco_seq_agg_max_float(&max_iterator, &close_iterator);
>                 mco_seq_agg_min_float(&min_iterator, &close_iterator);
>                 // Get min and max in a single call
>                 mco_seq_agg_min__max_float(&max_min_iterator, &close_iterator);
>                 ...
>             }
>         }