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

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -