SQL:``在选择列表中,'olumn'tbl.column'是无效的,因为它既
技术问答
319 人阅读
|
0 人回复
|
2023-09-12
|
我想知道为什么会出现以下错误:3 [( `: q: T1 @. G6 j( M6 y! r' l
Column 'tbl.column' is invalid in the select list because it is not contained
l& q! u" W! X$ Qin either an aggregate function or the GROUP BY clause.
% A+ m# d1 F9 csql语句如下:5 f" P' _* t: I
SELECT tbl.column, MAX(tblOther.columnOtherId) AS otherID FROM (tbl INNER6 I3 |% s9 ~5 k+ X5 ?- d
JOIN tblOther ON tbl.columnId = tblOther.columnOtherId) INNER JOIN9 c M9 E& j2 u& Z) ]0 T- @, i3 i
tblOtherAgain ON tblOther.columnOtherId = tblOtherAgain.columnAgainOtherId6 u# T* o$ i7 J& H7 H
WHERE tblOther.columnOtherAgainId = @id。' S" R, m) ~3 u4 `+ s5 Z4 J
当我删除聚合函数 MAX时8 e* q: |. Y+ e- w( E
,tblOther.columnOtherId我没有收到以上错误。那么,如何在不出现所示错误的情况下使上面显示的语句起作用?
: S% _9 O1 F( CDBLibrary: Tedious.js, G% ?0 J$ Z7 u6 K ~' L( p
7 p$ l% X, M( a6 u; E" T2 [+ l解决方案: |
|
|
|
|
|