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 15
Additional examples:
Using Sample SQL
text constant SELECT 'CatDog' FROM Salespeople
numeric constant SELECT 999 FROM Salespeople
date constant SELECT DATE '2016-06-05' FROM Salespeople
time constant SELECT TIME '02:49:03' FROM Salespeople
timestamp constant SELECT TIMESTAMP '2016-06-05 02:49:03' FROM Salespeople
text column SELECT Company_Name FROM Sales_Data
SELECT DISTINCT Company_Name FROM Sales_Data
numeric column SELECT Amount FROM Sales_Data
SELECT DISTINCT Amount FROM Sales_Data
date column SELECT Date_Sold FROM Sales_Data
SELECT DISTINCT Date_Sold FROM Sales_Data
time column SELECT Time_Sold FROM Sales_Data
SELECT DISTINCT Time_Sold FROM Sales_Data
timestamp column SELECT Timestamp_Sold FROM Sales_Data
SELECT DISTINCT Timestamp_Sold FROM Sales_Data
BLOB
a
a. A BLOB is a FileMaker database file container field.
column SELECT Company_Brochures FROM Sales_Data
SELECT GETAS(Company_Logo, 'JPEG') FROM Sales_Data
Wildcard * SELECT * FROM Salespeople
SELECT DISTINCT * FROM Salespeople
Notes from the examples
A col
umn is a reference to a field in the FileMaker database file. (The field can contain many
distinct values.)
The asterisk (*) wildcard character is shortha
nd for “everything”. For the example SELECT *
FROM Salespeople, the result is all the columns in the Salespeople table. For the example
SELECT DISTINCT * FROM Salespeople, the result is all the unique rows in the
Salespeople table (no duplicates).
1 FileMaker does not store data for empty strings, so the following queries always return no
records:
SELECT * FROM test WHERE c =’’
SELECT * FROM test WHERE c <>’’
1 If you use SELECT with binary data, you must use the GetAs() function to specify the stream
to return. See the following section “Retrieving the contents of a container field: CAST() function
and GetAs() function,” for more information.