ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Vinokurov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-7785) SQL query with COUNT and UNION in sub-query produces JdbcSQLException
Date Thu, 22 Feb 2018 08:26:04 GMT
Pavel Vinokurov created IGNITE-7785:
---------------------------------------

             Summary: SQL query with COUNT and UNION in sub-query produces JdbcSQLException
                 Key: IGNITE-7785
                 URL: https://issues.apache.org/jira/browse/IGNITE-7785
             Project: Ignite
          Issue Type: Bug
          Components: sql
    Affects Versions: 2.3, 2.1
            Reporter: Pavel Vinokurov


SQL initial script:

CREATE TABLE Person(id INTEGER PRIMARY KEY, company_id INTEGER);
CREATE TABLE Company(id INTEGER PRIMARY KEY, name VARCHAR);
INSERT INTO Person(id,company_id) VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO Company(id,name) VALUES (1,'n1'), (2,'n2'), (3,'n3');

SQL Query:

SELECT count(*) FROM person p
LEFT JOIN (select id from company union select id from company) as c on c.id=p.company_id

SQL error:

Caused by: org.h2.jdbc.JdbcSQLException: Column "P__Z0.COMPANY_ID" must be in the GROUP BY
list; SQL statement:
SELECT
P__Z0.COMPANY_ID __C0_0,
COUNT(*) __C0_1
FROM PUBLIC.PERSON P__Z0 [90016-195]

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message