79376476

Date: 2025-01-22 03:41:36
Score: 0.5
Natty:
Report link

You can modify the column names in the output with the AS clause. For example, to shorten the column names and show them without quotes, run the following query:

    SELECT *
FROM SALES_DATA
PIVOT (
    SUM(SALES_AMOUNT) -- Aggregation function
    FOR PRODUCT IN ('PRODUCT_A', 'PRODUCT_B', 'PRODUCT_C')
) as p(data_s,PRODUCT_A, PRODUCT_B, PRODUCT_C);

enter image description here

Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
Posted by: Sriga