Tablo 1BigQuery'yi katılmak coalesce
+---------+-----------+--------+
| user_id | email | action |
+---------+-----------+--------+
| 1 | [email protected] | open |
+---------+-----------+--------+
| 2 | null | click |
+---------+-----------+--------+
| 3 | [email protected] | click |
+---------+-----------+--------+
| 4 | [email protected] | open |
+---------+-----------+--------+
Tablo 2
ben dayalı katılmak istiyorum+---------+-----------+--------+
| user_id | email | event |
+---------+-----------+--------+
| 1 | [email protected] | sent |
+---------+-----------+--------+
| null | [email protected] | none |
+---------+-----------+--------+
| 2 | [email protected] | sent |
+---------+-----------+--------+
| 4 | [email protected] | sent |
+---------+-----------+--------+
t1.user_id = t2.user_id ama boş için varken COALESCE oN)
1. (t1.user_id, t1.email) = COALESCE (t2.user_id t2: anahtar, ben BigQuery'deki artır için birden fazla yol çalıştı
t2.email = t1.email birleştirmektir. e-posta)AÇIK durumda 2.) t2.user_id
Ne iş sonu
t2.email = sonra t1.user_id = t2.user_id başka t1.email boş değilken. Bu nasıl yapılabilir?
SQL katılmak için e-posta ile katılmak "DISTINCT IS "ve" DISTINCT DEĞİL "ama BigQuery'de bunu göremiyorum. –