3

I am trying to run simple query on Google Bigquery. But each time when I run the query SELECT COUNT(totals.visits) FROM 122443995.ga_sessions_20160817 I get following error

Encountered " "FROM" "FROM "" at line 1, column 29. Was expecting: <EOF>

What could be the possible error in the query syntax?

2 Answers 2

4

You probably need to escape the table name. With legacy SQL, you would use square brackets, e.g.:

SELECT COUNT(totals.visits) FROM [122443995.ga_sessions_20160817];

With standard SQL, you would use backticks, e.g.:

SELECT COUNT(totals.visits) FROM `122443995.ga_sessions_20160817`;
Sign up to request clarification or add additional context in comments.

Comments

1

For me, using parentheses to surround the clause in FROM solved it for me. So instead of

SELECT totals FROM t1

use

SELECT totals FROM (t1)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.