0
votes

https://cloud.google.com/bigquery/sql-reference/data-types

As the documentation mentions, the following syntax should be working : This syntax can also be used with STRUCT comparison for comparison expressions using multi-part keys,

e.g. in a WHERE clause: WHERE (Key1,Key2) IN ( (12,34), (56,78) )

I am trying the same query and I get a syntax error:

SELECT a, b FROM some_table WHERE (a, b) IN ( (11332728, 126), (12312, 3131 ) );

" Encountered " "," ", "" at line 3, column 10. Was expecting: ")" .."

Have you used this ? Can you please give me an example ?

1
Count ( and count ). Same number? - jarlh
I am sorry, I fixed it. In my real example, I have counted and they all look alright - Catalin Lupuleti
Seems like the documentation is ahead of the product... (Your syntax is valid ANSI SQL.) - jarlh
@onedaywhen, Yes, I know it's an ISO standard (ISO/IEC 9075), but it seems like most people and products still refer to it as ANSI SQL. And, yes no 2, this syntax was introduced in SQL-99. - jarlh

1 Answers

1
votes

Make sure to enable standard SQL for the query before running it. Based on the error message, it sounds like you might be using legacy SQL.