Leeoniya
03-02-2008, 08:29 PM
Lets say i have an inventory of items. all the common attributes are contained in the main inventory table (price, cost, supplier, upc, sku, mfg...etc). while all the type-specific attributes are contained in type specific table....so inventory_watches would have fields like case material, series, band type, etc. the type specific tables are foreign keyed on the primary inventory_ids.
i would like to make an inventory browser that would allow arbitrary categorization - kind of like reordering an ORDER BY, but not flat in a sense.
given a group of items of different types (after a join). i want further grouping:
item type > price range
price range > item type
item type > item attribute > price range
i'd like to assemble a dynamic query (from presets) so that this can be done in any order.
now my mySQL question: do i need to issue the full query each time as it is built, or can i run a SELECT from the last result? do i need temporary tables or does the DB cache the last result?
thanks,
Leon
i would like to make an inventory browser that would allow arbitrary categorization - kind of like reordering an ORDER BY, but not flat in a sense.
given a group of items of different types (after a join). i want further grouping:
item type > price range
price range > item type
item type > item attribute > price range
i'd like to assemble a dynamic query (from presets) so that this can be done in any order.
now my mySQL question: do i need to issue the full query each time as it is built, or can i run a SELECT from the last result? do i need temporary tables or does the DB cache the last result?
thanks,
Leon