Ini dia sintaks PIVOT
SELECT Name,[1] as Animal, [2] as Color
FROM
(SELECT Name,Id,Value
FROM Table) AS SourceTable
PIVOT
(
MIN(Value)
FOR Id IN ([1], [2])
) AS PivotTable;
Ini dia sintaks PIVOT
SELECT Name,[1] as Animal, [2] as Color
FROM
(SELECT Name,Id,Value
FROM Table) AS SourceTable
PIVOT
(
MIN(Value)
FOR Id IN ([1], [2])
) AS PivotTable;
Bagaimana cara mengubah nilai kolom identitas secara terprogram?
Cara Menghasilkan Data Uji di SQL Server
Alih-alih NULL, bagaimana cara menampilkan `0` dalam hasil dengan pernyataan SELECT sql?
Bagaimana menghindari kondisi balapan basis data saat secara manual menambah PK dari baris baru
SQL Server Management Studio – tips untuk meningkatkan proses pengkodean TSQL