SQL Reference
Table Of Contents
- Chapter 1 Introduction
- Chapter 2 Supported standards
- Support for Unicode characters
- SQL statements
- SELECT statement
- SQL clauses
- FROM clause
- WHERE clause
- GROUP BY clause
- HAVING clause
- UNION operator
- ORDER BY clause
- OFFSET and FETCH FIRST clauses
- FOR UPDATE clause
- DELETE statement
- INSERT statement
- UPDATE statement
- CREATE TABLE statement
- TRUNCATE TABLE statement
- ALTER TABLE statement
- CREATE INDEX statement
- DROP INDEX statement
- SQL expressions
- SQL functions
- FileMaker system objects
- Reserved SQL keywords
- Index
Chapter 2 | Supported standards 28
Operator precedence
As expressions become more complex, the order in which the expressions are evaluated
becomes important. This table shows the order in which the operators are evaluated. The
operators in the first line are evaluated first, and so on. Operators in the same line are evaluated
left to right in the expression.
Examples
WHERE salary > 40000 OR hire_date > (DATE '2008-01-30') AND dept =
'D101'
Because AND is evaluated first, this que
ry retrieves employees in department D101 hired
after January 30, 2008, as well as every employee making more than $40,000, no matter what
department or hire date.
To force the clause to be evaluated in a different order, use paren
theses to enclose the
conditions to be evaluated first.
WHERE (salary > 40000 OR hire_date > DATE '2008-01-30') AND dept =
'D101'
This example retrieves employees in department D101 that either ma
ke more than $40,000
or were hired after January 30, 2008.
SQL functions
Claris provides an implementation of the SQL standard for the FileMaker Platform and supports
many functions you can use in expressions. Some of the functions return characters strings, some
return numbers, some return dates, and some return values that depend on conditions met by the
function arguments.
Aggregate functions
Aggregate functions return a single value from a set of records. You can use an aggregate function
as part of a SELECT statement, with a field name (for example, AVG(SALARY)), or in combination
with a column expression (for example, AVG(SALARY * 1.07)).
You can precede the column expression with the DIS
TINCT operator to eliminate duplicate
values.
Precedence Operator
1Unary '-', Unary '+'
2^, **
3*, /
4 +, -
5 =, <>, <, <=, >, >=, Like, Not Like, Is Null, Is Not Null, Between, In, Exists, Any, All
6Not
7AND
8OR