[jira] [Commented] (DERBY-7051) Multiple DISTINCT columns are not supported
[ https://issues.apache.org/jira/browse/DERBY-7051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16907714#comment-16907714 ] JackLi0812 commented on DERBY-7051: --- {code:java} SELECT DISTINCT (SELECT COUNT(ORDERS.CUSTOMER_ID) FROM ORDERS), (SELECT COUNT(DISTINCT ORDERS.CUSTOMER_ID) FROM ORDERS), (SELECT COUNT(ORDERS.ORDER_ID) FROM ORDERS), (SELECT COUNT(DISTINCT ORDERS.ORDER_ID) FROM ORDERS) FROM ORDERS ; {code} It's working for me. > Multiple DISTINCT columns are not supported > --- > > Key: DERBY-7051 > URL: https://issues.apache.org/jira/browse/DERBY-7051 > Project: Derby > Issue Type: Bug > Components: JDBC > Environment: derby-10.11.1.1; >Reporter: JackLi0812 >Priority: Major > > > {code:java} > SELECT DISTINCT (ORDERS.CUSTOMER_ID), DISTINCT (ORDERS.ORDER_ID) > FROM ORDERS > ORDER BY ORDERS.ORDER_ID > ;{code} > throw error: > {code:java} > SQL Error [42X01]: Syntax error: Encountered "DISTINCT" at line 1, column 39. > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016)
[jira] [Commented] (DERBY-7051) Multiple DISTINCT columns are not supported
[ https://issues.apache.org/jira/browse/DERBY-7051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16907241#comment-16907241 ] Rick Hillegas commented on DERBY-7051: -- Try this: {noformat} connect 'jdbc:derby:memory:db;create=true'; CREATE TABLE t(userName VARCHAR(50), product VARCHAR(50)); SELECT (SELECT DISTINCT userName FROM t) userCount, (SELECT DISTINCT product FROM t) productCount FROM sysibm.sysdummy1; {noformat} > Multiple DISTINCT columns are not supported > --- > > Key: DERBY-7051 > URL: https://issues.apache.org/jira/browse/DERBY-7051 > Project: Derby > Issue Type: Bug > Components: JDBC > Environment: derby-10.11.1.1; >Reporter: JackLi0812 >Priority: Major > > > {code:java} > SELECT DISTINCT (ORDERS.CUSTOMER_ID), DISTINCT (ORDERS.ORDER_ID) > FROM ORDERS > ORDER BY ORDERS.ORDER_ID > ;{code} > throw error: > {code:java} > SQL Error [42X01]: Syntax error: Encountered "DISTINCT" at line 1, column 39. > {code} -- This message was sent by Atlassian JIRA (v7.6.14#76016)