Database Reference
In-Depth Information
The query results appear in Figure 3-12. Because more than one customer is located in Grove, there are
multiple records in the query results.
81
Customers
located in Grove
FIGURE 3-12
Query results
You can also use dates in conditions. The format for using dates in queries varies slightly from one
implementation of SQL to another. In Access, you place number signs around the date (for example,
#11/15/2013#). In other programs, you enter the day of the month, a hyphen, the three-character abbrevia-
tion for the month, a hyphen, and the year, all enclosed in single quotation marks (for example,
15-NOV-2013 ' ).
EXAMPLE 7
List the number, name, credit limit, and balance for all customers with credit limits that exceed their
balances.
The query design appears in Figure 3-13. Notice that the condition in the WHERE clause compares the
contents of two fields.
Condition (credit
limit must be greater
than balance)
FIGURE 3-13
SQL query to find all customers with credit limits that exceed their balances
The query results appear in Figure 3-14.
Search WWH ::




Custom Search