[
https://issues.apache.org/jira/browse/DERBY-2374?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769012#action_12769012
]
Mamta A. Satoor commented on DERBY-2374:
----------------------------------------
I tried the following simple script on trunk and got the error reported in this
jira.
connect 'jdbc:derby:c:/dellater/db;create=true';
create table t1 (c1 int);
create table t2 (c1 int);
select c1 from ((select c1 from t1) union (select c1 from t2)) t1t2;
BTW, the script above also fails on 10.1 so it seems like Derby never allowed
this SQL-standard allowed syntax.
I am just collecting some basic info on this and thought would share them.
> UNION PROBLEM WITH PARENTHESIS
> ------------------------------
>
> Key: DERBY-2374
> URL: https://issues.apache.org/jira/browse/DERBY-2374
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.2.2.0
> Reporter: Kenneth Gee
> Priority: Minor
>
> The following query shows the error using the Derby demo toursDB:
> SELECT FLIGHT_ID , SEGMENT_NUMBER , ARRIVE_TIME
> FROM (
> (SELECT HW.FLIGHT_ID , HW.SEGMENT_NUMBER , HW.ARRIVE_TIME FROM
> FLIGHTS HW)
> UNION
> (SELECT SW.FLIGHT_ID , SW.SEGMENT_NUMBER , SW.ARRIVE_TIME FROM
> FLIGHTS SW)
> ) SRC;
> ERROR 42X01: Syntax error: Encountered "UNION" at line 4, column 12.
> The following query works:
> SELECT FLIGHT_ID , SEGMENT_NUMBER , ARRIVE_TIME
> FROM (
> SELECT HW.FLIGHT_ID , HW.SEGMENT_NUMBER , HW.ARRIVE_TIME FROM
> FLIGHTS HW
> UNION
> SELECT SW.FLIGHT_ID , SW.SEGMENT_NUMBER , SW.ARRIVE_TIME FROM
> FLIGHTS SW
> ) SRC;
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.