我有三个表ProductMaster
和ProductParameter
和ParameterMaster
。SQL Server中列名重复的行
ProductMaster
包含多个产品,每个产品有多个参数,其值存储在productparameter
中。
现在我需要ProductParameter
值作为列。我正在使用数据透视表,但我只能获得一个产品价值。我要像
ProductID Name ParameterValue1 ParameterValue2
--------------------------------------------------------------
1 Product-1 test test2
2 Product- anothervalue another value2
表中的所有产品的清单是如下
参数主
ParameterID
Name
ProductParameter
ProductParameterID
ProductID
ParameterID
Value
ProductMaster
ProductID
Name
后的样本数据和预期的输出,帮助您更好 –