我想知道为什么会出现以下错误:
Column 'tbl.column' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
当sql语句看起来像:
SELECT tbl.column, MAX(tblOther.columnOtherId) AS otherID FROM (tbl INNER JOIN tblOther ON tbl.columnId = tblOther.columnOtherId) INNER JOIN tblOtherAgain ON tblOther.columnOtherId = tblOtherAgain.columnAgainOtherId WHERE tblOther.columnOtherAgainId = @id
当我在tblOther.columnOtherId
上删除聚合函数MAX时 ,我没有收到以上错误。 那么,如何在不出现所示错误的情况下使上面显示的语句起作用?
DBLibrary: Tedious.js