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 9
SQL clauses
The ODBC and JDBC client drivers provide support for the following SQL clauses.
Note If you attempt to retrieve data from a table with no columns, the
SELECT statement returns
nothing.
FROM clause
The FROM clause indicates the tables that are used in the SELECT statement. The format is:
FROM table_name [table_alias] [, table_name [table_alias]]
table_name is the name of a table in the current database. The table name must begin with an
alphabetic character. If the table name begins with other than an alphabetic character, enclose it
in double quotation marks (quoted identifier).
table_alias
can be used to give the table a more descriptive name, to abbreviate a longer table
name, or to include the same table in the query more than once (for example, in self-joins).
Field names begin with an alphabetic character. If the field name beg
ins with other than an
alphabetic character, enclose it in double quotation marks (quoted identifier).
Example
The ExecuteSQL statement for the field named _LASTNAME is:
SELECT "_LASTNAME" from emp
Use this SQL clause To
FROM (page 9) Indicate which tables are used in the SELECT statement.
WHERE (page 11) Specify the conditions that records must meet to be retrieved (like a FileMaker Pro find
request).
GROUP BY (page 11) Specify the names of one or more fields by which the returned values should be grouped.
This clause is used to return a set of aggregate values by returning one row for each group
(like a FileMaker Pro subsummary).
HAVING (page 12) Specify conditions for groups of records (for example, display only the departments that
have salaries totaling more than $200,000).
UNION (page 12) Combine the results of two or more SELECT statements into a single result.
ORDER BY (page 13) Indicate how the records are sorted.
OFFSET (page 13) State the number of rows to be skipped before starting to retrieve rows.
FETCH FIRST (page 13) Specify the number of rows to be retrieved. No more than the specified number of rows are
returned although fewer rows may be returned if the query yields less than the number of
rows specified.
FOR UPDATE (page 14) Perform Positioned Updates or Positioned Deletes via SQL cursors.