score:4

Accepted answer
/*
set @query = 'select ' + char(13) + 'case when a.location is not null then 
    upper(left(a.location, 1)) + right(a.location, len(a.location) - 1) 
    else ''all'' end as location' + char(13) + @strsql + 'group by ' 
    + char(13) + 'rollup(location)' + char(13)  
 */
 select 'a' as location, 'b' as othercol, 'c' as col3 

Related Query