Expression

Description

(SELECT [UnitPrice] FROM [Products] WHERE [ProductName] = "Red Widget")

Displays Products whose price is the same as the price of the Red Widget.

> (SELECT Avg([UnitPrice]) FROM [Products])

Displays Products that have a unit price above the average.

> (SELECT [Salary] FROM [Employees] WHERE ([Title] LIKE "*Manager*") OR ([Title] LIKE "*Vice President*"))

Displays Salary of every sales representative whose salary is higher than that of all employees with "Manager" or "Vice President" in their titles.

> (SELECT Avg([UnitPrice] * [Quantity]) FROM [Order Details])

Displays Orders with totals that are higher than the average order value.

 

For a complete list of built-in functions, see Chapter 19: Predefined Variables and Built-in Functions.