Create a view...

  • hello,

    i have a customer table and than a customer group group table which is basically grouping customers

    Than i have a table price like:

    cust1 item1 price

    cust2 item2 price

    cust3 item2 price

    cg1 item5 price

    where cg1 is a group and has cust1 and cust2.

    I need to create a view with the result like the following which are basically the prices exploded:

    cust1 item1 price

    cust2 item2 price

    cust3 item2 price

    cust1 item5 price

    cust2 item5 price

     

    how can i achieve this result?

  • I don't really follow what you mean by the prices "exploded". Meaningful sample data and your expected result will help us here. At a guess, however, are you talking about a CROSS JOIN?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • >> I have a customer table and than a customer group group table which is basically grouping customers <<

    Why did you fail to post any DDL? Why is the sample data done is a picture that we have to transcribe into a table for you? If the people you're working with are this rude to you, you should quit. Did you really expect people that are helping you for free to do everything for you? That's a bit arrogant, don't you think?

    Looking at the narrative version of a price table, why is a customer identifier part of the price? I have seen systems which have classes of customers that get different prices, but you seem to want to have a different price for every customer.

    Where's the reference over to the inventory for the items?

    >> I have a table price like:

    cust1 item1 price

    cust2 item2 price

    cust3 item2 price

    cg1 item5 price

    where cg1 is a group and has cust1 and cust2. <<

    What is the relationship between the individual customers and the groups it comes to prices? What if the group rate is higher or lower than the individual customers price?

    Please post DDL and follow ANSI/ISO standards when asking for help. 

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

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