
您使用了聚合函数,
MAX()并且
SELECt子句中有一个未聚合的字段,这就是为什么您需要有
GROUP BY子句的原因,
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.SourceId WHERe tblOther.columnOtherAgainId = @idGROUP BY tbl.column
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)