我在 SQL Server 2008 数据库中有大量行
对于每一行,我有 3 列我关心
典型的行如下所示:
AccountNumber | basecode | subcode
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9689787209368901 | AQTXG AQTXG AQTXG AQTXG ACC5Z | ZQ596 ZQ596 ZQ596 ZQ655 ZC655
我需要一个 SQL 查询,将其转换为以下内容:
AccountNumber | basecode| subcode
+++++++++++++++++++++++++++++++++++++++++++
9689787209368901 | AQTXG | ZQ596
9689787209368901 | AQTXG | ZQ596
9689787209368901 | AQTXG | ZQ596
9689787209368901 | AQTXG | ZQ655
9689787209368901 | ACC5Z | ZC655