• lak.konduri (10/21/2012)


    I have one table and the columns are bookingreference,complaintreference,category1,category2,desriptionofthecomplaint,

    one bookingref have one complaintid,

    one complaintid have many bookingreferences,

    one complaintid have many categories and one category have many complaintid,

    one complaintid have many category2 and one category 2 have many complaints.

    I need to prepare the data into tables and load them to prepare reports on it.

    can anyone suggest me the best approach.

    Thanks pavan

    Depending on what the reporting requirements actually are, it would seem that LEFT OUTER JOINing all of the other tables to the BookingRef table on the ComplaintID would do the trick. This doesn't actually look like a many-to-many problem because of that.

    --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)