Forum Moderators: coopster
SELECT software_number, max(revision) as revision, models FROM software GROUP BY software_number
It gives me this error.
Warning: mssql_query(): message: Column 'software.models' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. (severity 16) in c:\inetpub\wwwroot\softorg\item_assign.php on line 149
The frustrating thing is that this very same select works great in MySQL.
Any suggestions on what the problem is and how I could do this in MSSQL?
Since I'm not really sure what you're trying to do (what the fields are, the way you want the results, etc.) you may need a "HAVING" clause in there if group by is required over order by.