Skip to content
Advertisement

Bigquery select records where array column in array value by ‘And’ condition

I have Bigquery table name_fruits like this…

I am trying to select names that who has fruits both apple and orange. Which means I want to select aaaa and bbbb.

The query needs to be dynamic. Can’t hardcode apple and orange in the query.

Is there any solution to select them?

Advertisement

Answer

If I understand correctly, you want to do this with variables. Hence:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement