As you know, the syntax is PIVOTas follows:
FROM table_source
PIVOT (
aggregate_function ( value_column )
FOR pivot_column
IN ( <column_list>)
) table_alias
I want to know if it is possible to transfer the request as <column_list>to PIVOT?
In action I want to write
FOR DepartmentName IN (SELECT Name From Department))
instead
FOR DepartmentName IN ([Production], [Engineering], [Marketing]))
source
share