best approach for quary

  • i"m trying to find a better approach then nested queries for this problem.

    i have two tables :

    basket fruit quantity

    small apples 2

    small peaches 1

    small bananas 1

    small oranges 1

    medium apples 3

    medium peaches 2

    medium bananas 2

    medium oranges 2

    large apples 6

    large peaches 3

    large bananas 5

    large oranges 6

    invoice basket quantity

    1 small 2

    1 medium 1

    1 large 4

    first table describes which fruit go into a basket

    second tables tells how many of each basket sold per invoice

    my Objective is to get the total of each fruit sold

    any suggestions?

  • You will probably want to lookup INNER JOIN for this problem that looks an awful lot like homework .

    [font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
    Proactive Performance Solutions, Inc.
    [/font]
    [font="Verdana"] "Performance is our middle name."[/font]

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

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