Hi guys I'm trying to use unpivot in SQL on MS Access and I found the following code online:
SELECT CustomerID, Phone
FROM
(
SELECT CustomerID, Phone1, Phone2, Phone3
FROM dbo.CustomerPhones
) AS cp
UNPIVOT
(
Phone FOR Phones IN (Phone1, Phone2, Phone3)
) AS up;
from this webpage: https://www.mssqltips.com/sqlservertip/3000/use-sql-servers-unpivot-operator-to-help-normalize-output/
However when I tried the exact same code on Access, it keeps saying the FROM
clause has an error.
I wonder if this is because the syntax for access is somehow different from that in SQL server? I would really appreciate it if anyone could tell me how to make this code run.