I have a table t1 with structure:
- id: integer
- name: repeated (string)
I have entries with multiple names:
- 123; name1,name2
- 124; name1,name3,name4,name5
- 125; name1,name4,name7
I want to return lines (unique) that have name equal name1 and name4 which would return line 2 and 3, id 124 and 125
Bigquery automatically flatens results. But that makes hard to return rows that include multiple
And must do this with LegacySQL because of some constraints. I've tried:
SELECT _id AS _id, GROUP_CONCAT_UNQUOTED(name) AS name where name like "%name1%" and name like "%name4%"
Tried with = as well and not working.
Also this one returns all lines because of name1:
name IN ("name1", "name4")
( name = "name1" or name = "name4")