A window function is a function that operates on a set of rows and returns a single result for each row based on the rows within a specified "window" of rows. It is different from a regular function in that it does not operate on a single value but rather on a set of values.  For example, the following query uses the AVG() window function to return the average order total for each customer:  SELECT CustomerID, Total, AVG(Total) OVER (PARTITION BY CustomerID) AS AvgOrderTotal
FROM Orders;