chriszarate / sheetrock

Quickly connect to, query, and lazy-load data from Google Spreadsheets.
https://chriszarate.github.io/sheetrock/
818 stars 122 forks source link

Order of Query Importance #122

Closed tjferry14 closed 7 years ago

tjferry14 commented 7 years ago

How important is the order of the query? Using "select O,count(C),A group by O order by O" gives me an error, so I was wondering if the order had anything to do with it

chriszarate commented 7 years ago

The docs are pretty clear about the necessary order:

https://developers.google.com/chart/interactive/docs/querylanguage#language-clauses

I think your error is probably related to your use of group by:

"Note: If you use a group by clause, then every column listed in the select clause must either be listed in the group by clause, or be wrapped by an aggregation function."