0
假設我有兩個分區表,分別爲customer
和items
,並且這兩個分區表均由country
和state
列進行分區。在Hive中加入分區表
鑑於我想要檢索特定國家和州的數據,這是加入這些表格的正確方法嗎?
select
customer.id,
customer.name,
items.name,
items.value
from
customers
join items
on customers.id == items.customer_id
and customers.country == 'USA'
and customers.state == 'TX'
and items.country == 'USA'
and items.state == 'TX'
還是應該將這些條件放在WHERE子句中?
and customers.country == 'USA'
and customers.state == 'TX'
and items.country == 'USA'
and items.state == 'TX'
這些條件應該放在WHERE子句中。 – highlycaffeinated