Mit Daten in Below Format: -Convert SQL-Daten in einem Format in ein anderes
valleyname value
Valley 1 0
Valley 1 22
Valley 1 74
Valley 1 116
Valley 1 0
Valley 1 182
Valley 1 184
Valley 2 30
Valley 3 30
Valley 4 80
Valley 5 60
Will ich haben in diesem Format konvertieren: -
Valley 1 Valley 2 Valley 3 Valley 4 Valley 5
22 30 30 80 60
74 NULL NULL NULL NULL
116 NULL NULL NULL NULL
182 NULL NULL NULL NULL
184 NULL NULL NULL NULL
wie kann ich diesen Ansatz Aufgabe?
Vielen Dank im Voraus.
Suche nach * T-SQL-Pivot * oder * T-SQL-dynamische Pivot * wenn die Anzahl der Valley-Werte sind variabel. –
Versuchen Sie auch nicht, Ihre Daten auf diese Weise zu formatieren, wenn Sie sie an eine Front-End-Reporting/Dashboard-Anwendung liefern, die dies für Sie mit zusätzlichen Funktionen tun kann, die sehr hilfreich sind. – iamdave
Bitte werfen Sie einen Blick auf [how-to-ask] (http://stackoverflow.com/help/how-to-ask) – swe