Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I am using a group by clause in a select query

For eg

select a.empname,a.phone,@designation from empdetails a where
a.joiningdate = '2010-11-04'
group by a.dept

For the above query, the below mentioned error occurs.

Each GROUP BY expression must contain at least one column that is not an outer reference.




Thanks and Regards,
MUGAMATHISMAIL K
Posted

1 solution

Hi mugamnath,

Change your query to somehting like this:

select a.empname,a.phone,@designation from empdetails a where
a.joiningdate = '2010-11-04'
group by a.dept, a.empname, a.phone, @designation
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900