I have one table that contains id as single column and multiple columns that are nested.
1)
An example schema for better understanding :
id - String,
childrenNames - String repeated,
animalNames - String repeated,
Another table contains only single columns
2)
An example schema for better understanding :
childrenName - String,
animalName - String
I need to know all the records from table 2) that are not in table 1) So both childrenName and animalName need to belong to one user, together.
I can add that I tried to select separately for each column from table 2) values that are 'IN' lists from table 1) but if it returns any row it can also mean both are belonging to two different ids (or more).
Example row table 1)
id: 1234,
childrenNames : ['Ana', 'Frank'],
animalNames : ['Rex', 'Max'],
Example rows table 2)
A)
childrenName : 'Ana',
animalName : 'Ozzy'
B)
childrenName : 'Frank',
animalName : 'Rex'
For above examples I should get the row A) from table 2) because 'Ozzy' does not belong to the id 1234 (lets suppose we do not have more records in table 1) )
Anyone idea how to solve such problem with BigQuery SQL (Standard or Legacy) ?