User Guide

Writing SQL 27
Statement clauses
Use the following keywords to refine SQL statements:
Operators
The following basic operators specify conditions and perform logical and numeric
functions:
SQL notes and considerations
When writing SQL in ColdFusion, keep the following guidelines in mind:
There is a lot more to SQL than what is covered here. It is a good idea to purchase
one or several SQL guides that you can refer to.
The data source, columns, and tables that you reference must exist in order to
perform a successful query.
Keyword Description
FROM Names the data tables for the operation
WHERE Sets one or more conditions for the operation
ORDER BY Sorts the result set in the specified order
GROUP BY Groups the result set by the specified select list items
Operator Description
AND Both conditions must be met
OR At least one condition must be met
NOT Exclude the condition following
LIKE Matches with a pattern
IN Matches with a list of values
BETWEEN Matches with a range of values
= Equal to
<> Not equal to
< Less than
> Greater than
<= Less than or equal to
>= Greater than or equal to
+ Addition
- Subtraction
/ Division
* Multiplication