Subject RE: [firebird-support] UNION syntax?
Author Sasha Matijasic
>
> I am trying to write a union query with FB 2.1 (using a query
> generator) and the following query generates an error:
>
> <QUERY>
> SELECT FIRST 1 *
> FROM (

REMOVE THIS==========> (

> SELECT "key" AS "UnionKey",
> "bool0" AS "UnionBoolean",
> "int0" AS "UnionInteger",
> "num0" AS "UnionNumber",
> "str0" AS "UnionString",
> "date0" AS "UnionDate",
> "datetime0" AS "UnionDateTime",
> "time0" AS "UnionTime",
> 0 AS "UnionID"
> FROM "Calcs" "Calcs 1"

REMOVE THIS==========> )

> UNION ALL

REMOVE THIS==========> (

> SELECT "key" AS "UnionKey",
> "bool1" AS "UnionBoolean",
> "int1" AS "UnionInteger",
> "num1" AS "UnionNumber",
> "str1" AS "UnionString",
> "date1" AS "UnionDate",
> "datetime0" AS "UnionDateTime",
> "time1" AS "UnionTime",
> 1 AS "UnionID"
> FROM "Calcs" "Calcs 2"

REMOVE THIS==========> )

> ) "Union"
> </QUERY>
>

Remove those 2 pairs of parens.

Sasha