Help with Special SELECT using a UNION

  •  

    I think there must be a clean solution for what I am trying to do, but I cannot see it, any help you guys could provide would be appriciated

     

    I have two tables that store product specs.

    The first table holds universal items, where there are 2 types that span an entire set of products.

    The second table contains product specific specs

     

    What I need to do is get a list with all product specs where there are universal * products

     

    The details tables are defined as

     

    Universal

    Formfactor, parameter, max, min

    Product

    ProductFamily, SubType, parameter, max, min

     

    I am guessing that I need some sort of union query that is based on

     

    select parameter, max, min from universal where formfactor='0'
    union
    select parameter, max, min from product where productfamily='001' and subtype='a'

     

    and this would be repeated distinct product * distinct universal

     

    Regards

    Martin

  • Are the tables linked? Otherwise, what you are doing will work, but be cumbersome. Is there some table of product families?

  • I do have productfamilies and universal tables which also hold version information

    with views to the latest version available

     

    so selecting from the universal view will return the list of available formfactors and selecting from productfamilies will return the available families + subtypes

    the key of the universal is formfactor

    the key of the product families is productfamily + subtype

     

    I did also make a view that combines them to give

    ID, universal, productfamily, subtype

    0018 A, 0, 018, A
    0018 B, 0, 018, B
    1018 A, 1, 018, A
    1018 B, 1, 018, B

    Martin

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply