Page 1 of 1

EXIST, UNION not documented?

Posted: Fri May 04, 2001 4:04 pm
by marc10
The intro to Ch 7 'Advanced Queries' says:
...
The final section introduces several advanced query
techniques, including ... subqueries using the
EXIST operator, and combining query results using
the UNION operator.

Um, where is this info? It's not in Ch 7 or any Ch or manual as far as I can tell.
(Also there are a fair number of Texis reserved words
listed in Ch 12 that are not documented anywhere.)

Am I missing something?

I tried using a UNION between 2 selects and it seems to work same as Oracle, it would just be nice to know about this. Perhaps its unsupported? Can I assume EXIST is the same story?

EXIST, UNION not documented?

Posted: Fri May 04, 2001 4:54 pm
by John
It appears that those sections of the manual were missed. UNION is supported, although it works more like Oracle's UNION ALL in that it does not do duplicate removal. EXISTS is also supported and should work as expected.

EXIST, UNION not documented?

Posted: Fri May 04, 2001 5:07 pm
by marc10
OK, can I do a UNION within a subquery:

select id from table where id in
(select id from ... where ...
UNION
select id from ... where ...)

I keep getting error:
syntax error at "UNION"

thanks

EXIST, UNION not documented?

Posted: Fri May 04, 2001 8:13 pm
by John
No, a subquery can only be a single simple SELECT. Is that not the same as:

select id from table where id in (select id from ...)
UNION
select id from table where id in (select id from ...)