select master/detail data in a single row

  • I have two tables.

    1st table has the following format:

    table name:student

    structure:

    student_id student_name

    1 John

    2 Marsh

    3 Samuel

    2nd table has the following format:

    table name:paymentDetails

    structure:

    student_id payment month

    1 1000 jan

    1 2000 feb

    1 3000 mar

    2 1000 jan

    i want an output table like following

    studentname payment month payment month payment month

    john 1000 jan 2000 feb 3000 mar

    please keep in mind that my details table(paymentDetails) can have any number of rows for a particular student_id

    I have read a lot of articles about cross apply/cross join/cross tabs/pivots ....but cant resolve my problem

  • Probably, you wil lhave to take a look at the following article on Dynamic Cross Tabs , written very well one of the SQL gurus , Jeff Moden;

    Click this to go through: Dynamic Cross Tabs

    [/url]

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

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