我不知道为什么,我发现了以下错误: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
。SQL:“列'tbl.column'在选择列表中无效,因为它不包含在聚合函数或GROUP BY子句中。”
当我删除聚合函数MAX on tblOther.columnOtherId
我没有收到上述错误。那么如何让上面显示的语句在没有显示错误的情况下工作呢?
DBLIBRARY:Tedious.js
由于@JW首先得到了答案,即使你的答案也是正确的,它将被选中为正确答案。 – camelCaseD