Sorry for the long title of the question.
I guess I'm on a loser at this, but by accident.
Is it possible to make the calculation of a calculated field in a table the result of an aggregated function applied to a field in another table.
i.e.
You have a table called a "mug", she has a child called "color" (which makes my head in the UK sick, but the seller from the USA, what are you going to do?), And this, in turn, has a child called "the size". Each table has a field called sold.
Size size increases by 1 for each mug of a certain color and size.
You want color.sold to constitute the aggregate size SUM.sold WHERE size.colorid = color.colorid
You want mug.sold to be a collection of SUM color.sold WHERE color.mugid = mug.mugid
In any case, to make mug.sold and color.sold just work on their own, or will I have to leave with triggers?
One monkey
source share