I have problem with group by in SQL Server
I have this simple SQL statement:
select * from Factors group by moshtari_ID
and I get
You need to apply aggregate function such as max(), avg() , count() in group by.
For example this query will sum totalAmount for all moshtari_ID
select moshtari_ID,sum (totalAmount) from Factors group by moshtari_ID;
output will be
moshtari_ID SUM 2 120000 1 200000