我有一个如下所示的采购表:
store_id. industry_code amt_age_18_24 amt_age_25-34 amt_men amt_women
1 1000 100 20 80 40
2 2000 100 100 130 70
我想要做的是找到每家商店按年龄和性别购买的每一个排列。像这样,每一行都是唯一的:
store_id. industry_code amt_age_18_24 amt_age_25-34 amt_men amt_women
1 1000 100 NULL 80 NULL
1 1000 100 NULL NULL 40
1 1000 NULL 20 80 NULL
1 1000 NULL 20 NULL 80
2 2000 100 NULL 130 NULL
2 2000 100 NULL NULL 70
2 2000 NULL 100 130 NULL
2 2000 NULL 100 NULL 70
最好的方法是什么?自加入?