arkguil commented on issue #22696: [SPARK-25708][SQL] HAVING without GROUP BY means global aggregate URL: https://github.com/apache/spark/pull/22696#issuecomment-490530838 Indeed. The following query fails in Postgresql: `select id from (select 1 as id) t having id > 0` `ERROR: column "t.id" must appear in the GROUP BY clause or be used in an aggregate function Position: 8` Seems like SQL standard is very loosly implemented across the different RDBMS, but the stanrdard indeed state clearly that HAVING requires GROUP BY: https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#having-clause Thanks for the quick followup. We will fix our queries :)
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
