Grrr....Apparantly SQL doesn't like the idea of using aggregate's in an update statement. I'm using the following select statement to select a count of children records, and link them to parent records. Problem is, when I try to run an update off of this statement, SQL politly informs me that "An aggregate may not appear in the set list of an UPDATE statement...". My easiest solution is to simply select the data into a temptable, and link it from there. Is there another way to make this work?
Code:
select
count(child.id),
parent.id
from
object parent,
object child
where
parent.typ=2 and
child.typ=4 and
parent.id=child.link1
group by
child.link1,
parent.id