SQLTeam.com | Weblogs | Forums

Error Group BY


#1

HI,

I have below query and is giving me error for: Each GROUP BY expression must contain at least one column that is not an outer reference. cant figure out?

Thanks.

(
select A.EMPLID
from TESTSCORE
WHERE A.LEARN_ID IN ('ST102','ST103','ST104')


#2

...
and A.EMPLID not IN
(
select EMPLID
from TESTSCORE
WHERE LEARN_ID IN ('ST102','ST103','ST104')
group by EMPLID
Having count(EMPLID) < 3)


#3

Thanks Scott! it was the Alias.. Ahhhh.. :slight_smile: