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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -