The FIRST and LAST functions are similar to the TOP and BOTTOM functions except that a limited set of groups are returned based on the group names instead of the metric values.This query returns the first 3 groups based on the alphabetical sorting of EventID values. LAST returns the last groups in descending sort order. These functions help with aggregate queries that must be “paged”.