
436
DEVELOPING
COLDFUSION 9 APPLICATIONS
Accessing and Using Data
Las
t
upda
te
d 8/5/2010
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)
Name(varchar)
1
Tennis
2
Baseball
3
Football
Table2
ID(int)
Sport(varchar)
3
Football
4
Volleyball
5
PingPong
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...