Have you ever experienced any of these errors when trying to run your query in BigQuery?
These errors indicate that BigQuery does not recognize the syntax you are using, or that there is some error in it.
So, how should I write the syntax of my queries?
For this purpose, we give you some recommendations that you should keep in mind to avoid errors:
1. BigQuery recommends the use of Standard SQL instead of Legacy SQL.
2. Type FROM without quotation marks and just put dataset.table, selecting the account.
3. Do not use French quotes in the query, only single or double quotes (Not this ➞ ` These ➞ ' or ").
Example
In Dataslayer according to the recommendations detailed in this article, you should write it like this:
SELECT * FROM dataset.table
In Dataslayer you have to specify the dataset but not the project, since the project is obtained by selecting the accounts.
To illustrate:
SELECT * FROM test_flow.Test_2311
You can verify that BigQuery generates this SQL automatically:
SELECT * FROM `bigquerytest-298608.test_flow.Test_2311`
If you put this code generated by BigQuery in the Dataslayer extension, the query will NOT work and you will get an error similar to those we have mentioned above.
If you want to get data from multiple tables, the SQL query must follow this example structure:
SELECT * FROM [dataset_id.test_1], [dataset_id.test_2]
For detailed instructions on how to build queries in BigQuery, we recommend exploring Google's documentation on query syntax.
As always, please contact us via our live chat on our website or via email if you still have doubts or questions. We are happy to help!