In addition to columns, we can group rows by expressions. The following query gets the total sales for each year. We use YEAR function to extract year from order date ( orderDate). We only consider orders with shipped status in the total sales. Notice that the expression appear in the SELECT clause must be the same as the one in the GROUP BY clause.