Querry does not pass in optimizer. Basically, the query runs correctly in a Toad session, but the optimizer reports a syntax error when encountering the PIVOT syntax.
ERROR:
The Parser did not identify the text as a valid SQL statement. ORA-00904: "BTST"."SHIP_TO": invalid identifier Invalid SQL statement. Verify that you have selected the right schema. Only one SQL statement can be optimized in this window. To analyze PL/SQL code or multiple SQL statements use the Scan SQL.