Hello, 

we aware strange behaviour of H2 when quering COUNT with subquery.

Prepare table:
CREATE TABLE Foo
(
  id INT PRIMARY KEY AUTO_INCREMENT,
  fieldName VARCHAR(30) NOT NULL,
);

Test simple query (works fine):
SELECT * from Foo as F1 INNER JOIN Foo F2 on F1.id = F2.id

Test same query with count:
SELECT count(*) FROM (
  SELECT * from Foo as F1 INNER JOIN Foo F2 on F1.id = F2.id
) q;

Got error: 
[42S21][42121] Duplicate column name "ID"; SQL statement:
select count(*) FROM (
SELECT * from Foo as F1 INNER JOIN Foo F2 on F1.id = F2.id) q [42121-192]


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to