Re: Calculated "virtual" rows
Posted by: Hauke P.
Date: July 18, 2012 03:56AM

Thank you for your reply. I had some trouble explaining what I'm trying to do.

My core problem is that I don't want to have all figures stored in fact_data. Only the "basic" figures should be stored there. All other figures should automatically be computed by MySQL using the "basic" figures in fact_data and figure-specific computation rules.

Therefore your suggestion to use this query...
SELECT  year_id, location_id, figure_id, value
FROM  fact_data    -- ###MAGIC###
WHERE  figure_id IN ("total_costs", "purchase_costs", "goods_costs")
AND  year_id = 2010;
...would only return the information for goods_costs as this is the only basic figure that MySQL could find there.

With the UNION query from my original post I wanted to give an example of a query that could kind of "dynamically create" the necessary figures on the fly. However, such an UNION query is not performant at all and also hard to maintain - that's why I'm looking for a suitable alternative.


Is this more helpful to understand my problem? Should I give you any more details of what I'm trying to do?

Options: ReplyQuote


Subject
Written By
Posted
July 11, 2012 04:03AM
Re: Calculated "virtual" rows
July 18, 2012 03:56AM
July 29, 2012 05:07AM
August 01, 2012 12:38PM
August 02, 2012 08:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.