Skip to content
Advertisement

Tag: google-bigquery

BigQuery: Best way to ORDER BY an arbitrary GROUP BY expression when that expression is not in the SELECT clause?

In the below query, I want to group all orders by the concatenation of firstname and lastname, and order the result set by that concatenation. I do not want to include the concatenation in the SELECT column list. BigQuery returns the following error for the query: ORDER BY clause expression references column [column_name] which is neither grouped nor aggregated It

BigQuery: Best way to ORDER BY an arbitrary GROUP BY expression?

In the below query, I want to group all orders by the concatenation of firstname and lastname, and order the result set by that concatenation. However, BigQuery returns the following error for the query: ORDER BY clause expression references column [column_name] which is neither grouped nor aggregated I can fix this by wrapping the ORDER BY clause in ANY_VALUE: Is

Advertisement