Please help me to fix this code.
error: "myView.queue is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."
select
a.account,
min(a.time_on) as Informal , a.queue as In_agent,
max (b.time_on) as Formal, b.queue as For_Agent
from dbo.myView a inner join dbo.myView b on a.account = b.account
where len(a.queue)> 2
group by a.account
error: "myView.queue is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."
select
a.account,
min(a.time_on) as Informal , a.queue as In_agent,
max (b.time_on) as Formal, b.queue as For_Agent
from dbo.myView a inner join dbo.myView b on a.account = b.account
where len(a.queue)> 2
group by a.account