Database Reference
In-Depth Information
The result is:
Because the default order is ascending, it is not necessary to specify ASC in the last SQL
statement. Thus, the following SQL statement is equivalent to the previous SQL query:
/* *** SQL-Query-CH02-14 *** */
SELECT *
FROM ORDER_ITEM
ORDER BY Price DESC, OrderNumber;
and produces the same results:
SQL WheRe Clause Options
SQL includes a number of SQL WHERE clause options that greatly expand SQL's power and
utility. In this section, we consider three options: compound clauses, ranges, and wildcards.
Compound WheRe Clauses
SQL WHERE clauses can include multiple conditions by using the SQL AND, OR, IN, and NOT
IN operators. For example, to find all of the rows in SKU_DATA that have a Department named
Water Sports and a Buyer named Nancy Meyers, we can use the SQL AND operator in our
query code:
/* *** SQL-Query-CH02-15 *** */
SELECT *
FROM
SKU_DATA
WHERE
Department='Water Sports'
AND
Buyer='Nancy Meyers';
The results of this query are:
 
Search WWH ::




Custom Search