I am converting some FoxPro code into SQL server stored procedures. I don't know FoxPro but managing to read and under the code; most of it is SQL anyway.
One problem I couldn't seem to solve is this piece of code that seems to work in FoxPro but doesn't in SQL server, or need a work around:
SELECT column1, sum(column2), column3
GROUP BY column1
seems to be working fine in FoxPro but if I do this in SQL server, I get
Server: Msg 8120, Level 16, State 1, Line 1
Column 'tableA.column1' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Any suggestions on how to work around it? Thanks!