i want to join two tables with group by
select t.acno,t.name,count(Q.trans) as test,Q.transvalue,q.transdate
from dbo.test t
inner join dbo.testaqc q
on t.acno=Q.acno
group by q.trans
but i am receiving the error:
Msg 8120, Level 16, State 1, Line 1 Column 'dbo.test.acno' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.