I have 2 tables in BigQuery. VIDEOS table contains video names and tags. CREATORS table contains information about video creators. The VIDEOS.tags field contains comma separated quoted strings.
I need to select all the videos that were tagged with names in the CREATORS table with results looks like this:
x
Title 1, Creator 1
Title 2, Creator 2
Title 3, Creator 2
Title 4, Creator 3
Title 5, Creator 3
But what I have below does not return any results in BigQuery.
SELECT
B.name AS Title,
C.creator_name AS Creator
FROM `project.database.VIDEOS` AS B, `project.database.CREATORS` AS C
WHERE B.tags LIKE CONCAT('%"', C.creator_name ,'"%')
Advertisement
Answer
In such cases it is usually because of differences in cases – try
WHERE LOWER(B.tags) LIKE CONCAT('%"', LOWER(C.creator_name) ,'"%')