22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

■ Both Numeric; for example, Tinyint, Smallint, Integer, Bigint, Double, Float, Real,<br />

Decimal, or Numeric<br />

■ Both Characters; for example, Char, Varchar, or LongVarchar<br />

■ Both Dates; for example, Time, TimeStamp, or Date<br />

NOTE<br />

Syntax<br />

select_expression = select_expression UNION [ALL] select_expression<br />

Example<br />

This example uses the following tables:<br />

Table1<br />

Query Of Queries does not support ODBC-formatted dates and times.<br />

Type(int) Name(varchar)<br />

1 Tennis<br />

2 Baseball<br />

3 Football<br />

Table2<br />

ID(int) Sport(varchar)<br />

3 Football<br />

4 Volleyball<br />

5 PingPong<br />

To combine Table1 and Table2, use a UNION statement, as follows:<br />

SELECT * FROM Table1<br />

UNION<br />

SELECT * FROM Table2<br />

The UNION statement produces the following result (UNION) table:<br />

Result table<br />

Type(int) Name(varchar)<br />

1 Tennis<br />

2 Baseball<br />

3 Football<br />

610 Using Query of Queries

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!