- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input int year byte prov int city byte commodity_type long consumption
- 1995 14 1401 6 15820
- 1999 14 1401 6 144288
- 2000 14 1401 6 13681
- 2001 14 1401 6 127879
- 1999 15 1501 6 1283
- 1998 15 1505 6 2168
- 1997 15 1501 6 3188
- 2000 15 1501 9 3137
- 1994 14 1402 6 13654
- 2007 14 1402 8 3589
- 1998 14 1403 6 2245
- 1999 14 1402 9 2790
- 2000 14 1401 9 34117
- 2001 14 1401 9 13689
- 1994 14 1405 6 34588
- end
想请教下各位老师,如何针对这里的每一条记录,匹配出在上一年份、同省范围内、而且生产同类别商品的其他所有城市的代码,同时也提取出这些城市在同种商品类别上的消费金额呢?
预计生成的结果如红字所示


雷达卡



[handshake]
京公网安备 11010802022788号







