I have a query encounterying this error message: Error: Scalar subquery produced more than one element
I want to join tables representing behaviors happening in different time period, but normal join seems not working:
select a.g, count(*) from
(select user_id as user,
(select x.value.string_value from
analytics_156934592.events_20180701
, unnest(event_params) as x where x.key = 'group') as g,(select x.value.string_value from
analytics_156934592.events_20180701
, unnest(event_params) as x where x.key = 'operation') as operationfrom
analytics_156934592.events_20180701
where event_name = 'book_now')ajoin
(select user_id as user,
(select x.value.string_value from
analytics_156934592.events_20180702
, unnest(event_params) as x where x.key = 'operation') as operationfrom
analytics_156934592.events_20180702
where event_name = 'book_now')bon a.user = b.user
where a.operation = 'no_car' and b.operation = 'confirm'
group by a.g
Not sure if it's a proper way to do joins with Big Query Standard Sql Also the solutions to previous similar questions didn't work for me.
Thanks for your help!