SQL server using UNPIVOT
Converting columns to rows using UNPIVOT \n\nSELECT product_id, store, price\nFROM \n( \n   SELECT product_id, \n    store1, \n    store2,  \n    store3 \n FROM
# Converting columns to rows using ```UNPIVOT``` \n```\nSELECT product_id, store, price\nFROM \n( \n   SELECT product_id, \n    store1, \n    store2,  \n    store3 \n FROM Products) AS ActualData\nUNPIVOT\n(\n       price\n       FOR store IN (store1, store2, store3)\n) AS UnpivotData\nWHERE price is not null\n```\n\ncheck this link for reference and explaination https://dotnettutorials.net/lesson/pivot-and-unpivot-sql-server/
['MS SQL Server']