Forum OpenACS Q&A: Response to an SQL question - urgent!

Collapse
Posted by Don Baccus on
Well, you have this many-to-one relationship that you're trying to map
on single rows created by "distinct on (content_item_id)".

Which push_weight do you expect the case statement to operate on for
that single row, if there are more than one category/subcategory
entries mapped to that row?

"group by" won't let you do this, it will force you to use an
aggregate function (count(), sum(), avg() etc) to collapse the
multiple push_weights into a single value.  You *have* to collapse the
multiple values somehow...

What do you plan to do with the push_weight values?  I assume this is
for a report or web page, right?  What do you plan to output?  That
might help me give you some more advice.