答案 0 :(得分:1)
假设您的映射存储在mapping
表中。
select a.member_id,m.mapped_product, min(a.activity_date) as activity_date
from member_activity a
inner join (select distinct product, mapped_product from mapping m) m on a.product=m.product
group by a.member_id,m.mapped_product