sql - `GROUP BY` expression -
i got error message:
msg 164, level 15, state 1, line 18
each group by
expression must contain @ least 1 column not outer reference below tsql:
declare @client_count int select @client_count=count(clt_nbr) client select case when status=3 'category1' else 'category2' end category ,count(*) count ,@client_count [total client] ,count(*) / @client_count percentage client_status status in (3,8) group status,@client_count
can me fix it?
thank you!
Comments
Post a Comment