You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Taras Ledkov (JIRA)" <ji...@apache.org> on 2018/03/07 13:35:00 UTC
[jira] [Assigned] (IGNITE-7879) SQL query with group by and
distinct in subquery produces JdbcSQLException
[ https://issues.apache.org/jira/browse/IGNITE-7879?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taras Ledkov reassigned IGNITE-7879:
------------------------------------
Assignee: Taras Ledkov
> SQL query with group by and distinct in subquery produces JdbcSQLException
> --------------------------------------------------------------------------
>
> Key: IGNITE-7879
> URL: https://issues.apache.org/jira/browse/IGNITE-7879
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Affects Versions: 2.1, 2.3
> Reporter: Pavel Vinokurov
> Assignee: Taras Ledkov
> Priority: Major
>
> 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 p.id,sum(p.id) FROM person p
> LEFT JOIN (select DISTINCT id from company) as c on c.id=p.company_id
> group by p.id
> Result:
> Caused by: org.h2.jdbc.JdbcSQLException: Column "P__Z0.ID" must be in the GROUP BY list; SQL statement:
> SELECT
> P__Z0.ID __C0_0,
> P__Z0.COMPANY_ID __C0_1,
> SUM(P__Z0.ID) __C0_2
> FROM PUBLIC.PERSON P__Z0 [90016-195]
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)