First off I know I am rotten at SQL and have managed to busk it for most of my career.
I am trying to write a stored proc and want to update a column with the count of lines for that condition
update
A a , B b , C c
set
a.count = count(c.id)
where
a.id = b.a_id AND
b.id = c.b_id ;
I get a "Invalid use of group function" error
If I set the line to
a.count = 1
I inserts to the table OK. thanks for any help
I am trying to write a stored proc and want to update a column with the count of lines for that condition
update
A a , B b , C c
set
a.count = count(c.id)
where
a.id = b.a_id AND
b.id = c.b_id ;
I get a "Invalid use of group function" error
If I set the line to
a.count = 1
I inserts to the table OK. thanks for any help




Comment