One to Many Relationships and Orderable Columns

Results 1 to 5 of 5

Thread: One to Many Relationships and Orderable Columns

  1. #1
    jasonb Guest

    Default One to Many Relationships and Orderable Columns

    This is based on an earlier posed question that left off one crucial bit of information. I need to have orderable columns.<BR><BR>Solutions posted thus far rely on the SQL to order and clump together records. This does not work if the "order by" must be changed dynamically. I know there are ways to do this, but what is the best when considering performance?<BR><BR>I am working on generating a report that will display a one to many relationship without redundancy. <BR><BR>Using an author/book example, here is my problem: For each book in the book table there may be several authors. As an author may have written other books or magazines, etc. the book table and the author table are seperate, but connected by a third join table. <BR><BR>I&#039;m trying to display in a row the title of the book, and then all the authors linked to that book. I figured I could create two records sets one for the book and one for the author, and then loop through the authors displaying all the linked entries, but this solution seems awfully cumbersome. I also considered dumping all the authors into an array and then looping through the array. I&#039;m fairly new to all this, so any help would be appreciated. <BR><BR>Thanks, Jason

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: One to Many Relationships and Orderable Column

    This should give you an idea<BR>

  3. #3
    JasonB Guest

    Default Ordering is the easy part - one to many is the pro

    The ordering article was great, but I need advice on displaying the one to many relationship.

  4. #4
    Join Date
    Dec 1969

    Default Yes? So what did I not show you?

    You just use my code but add in the ordering, as well.<BR><BR>What am I missing? What is the big deal?<BR><BR>

  5. #5
    Join Date
    Dec 1969

    Default See also... ASPFAQ answer on ordering, to show a slightly more sophisticated way to do it (includes ability to allow user to order ascending or descending).<BR><BR>Or see for a "live" demo of the same thing. Even with colors and little hokey arrows!<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts