Is there a way to construct a PIVOT's IN clause using a SELECT?
The T-SQL documentation of the FROM clause has this for the  specification:

&lt;pivoted_table&gt; ::=  
    table_source PIVOT &lt;pivot_clause&gt; [ [ AS ] table_alias ]  




&lt;pivot_clause&gt; ::=  
        ( aggregate_function ( value_column [ [ , ]...n ])   
        FOR pivot_column   
        IN ( &lt;column_list&gt; )   
    )




&lt;column_list&gt; ::=  
    column_name [ ,...n ]   




So no, it doesn't allow you to select the column names with a SELECT statement, and yes, you have to "hard-code" the PIVOT column names.