Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 441

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Example
If a structure named A contains a field named B, which contains a table named Products, you can refer to the table with
dot notation, as follows:
SELECT tape_ID, length
FROM A.B.Products;
Using joins
A join operation uses a single SELECT statement to return a result set from multiple, related tables, typically those
tables with a primary key - foreign key relationship. The two SQL clauses that perform joins are:
• WHERE clause: Query of Queries supports joins through a WHERE clause.
• INNER JOIN and OUTER JOIN: Query of Queries does not support joins through INNER JOIN or OUTER JOIN
clauses.
Note: Query of Queries supports joins between two tables only.
Using unions
The UNION operator lets you combine the results of two or more SELECT expressions into a single recordset. The
original tables must have the same number of columns, and corresponding columns must be UNION-compatible data
types. Columns are UNION-compatible data types if they meet one of the following conditions:
• The same data type; for example, both Tinyint
• Both Numeric; for example, Tinyint, Smallint, Integer, Bigint, Double, Float, Real, Decimal, or Numeric
• Both Characters; for example, Char, Varchar, or LongVarchar
• Both Dates; for example, Time, TimeStamp, or Date
Note: Query Of Queries does not support ODBC-formatted dates and times.
Syntax
select_expression = select_expression UNION [ALL] select_expression
Example
This example uses the following tables:
Table1
Type(int)
1
2
3
Table2
ID(int)
Sport(varchar)
3
Football
4
Volleyball
5
PingPong
Name(varchar)
Tennis
Baseball
Football
Last updated 1/20/2012
436

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents