本文介绍了如何删除重复的列?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
hi,在此表中
shop_code | product_id | v1 | shop_code | product_id | v2 |
1 | 11 | 1 | 1 | 11 | 4 |
1 | 12 | 2 | 1 | 12 | 5 |
1 | 13 | 3 | 1 | 13 | 6 |
组列是shop_code + product_id
但表中的这些列在v1和v2列之前出现两次
如何重新移动重复列并只留下一个唯一列
IE输出
shop_code | product_id | v1 | v2 |
1 | 11 | 1 | 4 |
1 | 12 | 2 | 5 |
1 | 13 | 3 | 6 |
so sho_code + product_id出现一次。
解决方案
hi, in this table
shop_code | product_id | v1 | shop_code | product_id | v2 |
1 | 11 | 1 | 1 | 11 | 4 |
1 | 12 | 2 | 1 | 12 | 5 |
1 | 13 | 3 | 1 | 13 | 6 |
group columns are shop_code+product_id
but these column in table occurs two times before v1 and v2 column
how to remove duplicate columns and left only one unique column
I.E output
shop_code | product_id | v1 | v2 |
1 | 11 | 1 | 4 |
1 | 12 | 2 | 5 |
1 | 13 | 3 | 6 |
so sho_code+product_id occure one time.
解决方案
这篇关于如何删除重复的列?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!