mingmwang commented on PR #4365: URL: https://github.com/apache/arrow-datafusion/pull/4365#issuecomment-1331584666
> @mingmwang look like alias can't be in groupby. > > sql 1999 > > ``` > <group by clause> Function > Specify a grouped table derived by the application of the <group by clause> to the result of the previously specified clause. > Format > <group by clause> ::= > GROUP BY <grouping specification> > <grouping specification> ::= > <grouping column reference> > | <rollup list> > | <cube list> > | <grouping sets list> > | <grand total> > | <concatenated grouping> > ``` > > pg: > > ``` > -- create > CREATE TABLE EMPLOYEE ( > a INTEGER PRIMARY KEY, > b INTEGER, > c INTEGER > ); > > -- insert > INSERT INTO EMPLOYEE VALUES (0001, 0001, 0001); > INSERT INTO EMPLOYEE VALUES (0002, 0002, 0002); > > -- fetch > SELECT sum(b) FROM EMPLOYEE group by a as hh; > > ERROR: syntax error at or near "as" > ``` You can try this: `select (a + b) as c, count(*) from Table_A group by 1` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
