Hi,
 I have experienced a strange behaviour in H2 1.3.172

CREATE TABLE X (
 num INT,
 str VARCHAR(50)
);

INSERT INTO X VALUES(10, 'aaa');
INSERT INTO X VALUES(20, 'xxx');

SELECT x.str, x.num FROM X x WHERE num > 0
UNION
SELECT x.str, x.num FROM X x WHERE num > 1
ORDER BY *x.*num;

DROP TABLE X;

This does not work! If I remove the table name *x.* however, the query 
works. The error is:

Order by expression "X.NUM" must be in the result list in this case; SQL 
statement:
SELECT x.str, x.num FROM X x WHERE num > 0 
UNION 
SELECT x.str, x.num FROM X x WHERE num > 1 
ORDER BY x.num 
[90068-172]<http://localhost:11111/query.do?jsessionid=ca37a3a91abb2da95e36d51c726d9d42#>
 90068/90068 

Is this behaviour expected or a bug? I have tested 1.3.154 - it works, 
1.3.170 it does not, neither 171.

Regards,
 Kornel

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To post to this group, send email to h2-database@googlegroups.com.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to