How do I return data as subset of another table?

  • Example I have two tables "Labor" and "Parts" need to return as follows

    Labor field 1

    Part1

    Part2

    Part3

    Labor field2

    Part1

    Part2

    Part3

    Any help would be appreciated

  • If you could provide table definitions and some sample data inserts that would be helpful. I'm sure that we can help with the query if you provide that.

    Thanks.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • darryljm (2/14/2011)


    Example I have two tables "Labor" and "Parts" need to return as follows

    Labor field 1

    Part1

    Part2

    Part3

    Labor field2

    Part1

    Part2

    Part3

    Any help would be appreciated

    I believe you should only have 1 labor field in the labor. What is the purpose of having two labor fields per part?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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