Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
469 views
in Technique[技术] by (71.8m points)

google bigquery - Join two arrays on same id

I have two tables:

  • table one with visit_id, revenue
  • table two with visit_id, array_products_visited with an array of products visited on my website
  • table three with visit_id, array_bought with an array of products bought on my website

When I join the everything, the products bought (table three) appear repeated by each and every products visited. How can I avoid this?

Thanks.

Edit: to help you understand what I mean

table one:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You need to add a WHERE clause that limits the rows, so you only see the ones where two.user_id=three.userid.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...