How do I include the column BY in a query?
I first tried =unique(query(data_table,"SELECT D, BY"))
Then, I tried to surround it with single quotes =unique(query(data_table,"SELECT D, 'BY'"))
Web Applications Stack Exchange is a question and answer site for power users of web applications. It only takes a minute to sign up.
Sign up to join this communityHow do I include the column BY in a query?
I first tried =unique(query(data_table,"SELECT D, BY"))
Then, I tried to surround it with single quotes =unique(query(data_table,"SELECT D, 'BY'"))
Put BY column identifier between back quotes, =unique(query(data_table,"SELECT D, `BY`"))
BY is a Google Query Language keyword. From https://developers.google.com/chart/interactive/docs/querylanguage#Identifiers
Identifiers
Identifiers (or IDs) are text strings that identify columns.
Important: If your identifier
- Has spaces,
- Is a reserved word,
- Contains anything but alphanumeric characters or underscores ([a-zA-Z0-9_]), or
- Starts with a digit
it must be surrounded by back-quotes (not single quotes).