Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Location
    -
    Posts
    1

    Unanswered: Grouping data...help...

    Well, I have database like this...

    [League],[Team A],[Team B]...[n]
    A xxx yyy
    A xxx yyy
    A xxx yyy
    B xxx yyy
    B xxx yyy
    B xxx yyy
    C xxx yyy
    C xxx yyy
    C xxx yyy

    ...and want to display results like this

    A
    ---------
    xxx yyy
    xxx yyy
    xxx yyy

    B
    ---------
    xxx yyy
    xxx yyy
    xxx yyy

    C
    ---------
    xxx yyy
    xxx yyy
    xxx yyy

    ...anyone got the idea...can help me?
    Thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    don't do this in sql

    do this in a reporting program that calls sql

    for example, ColdFusion (which can work with MySQL) has a CFOUTPUT tag to print query results, and an option called GROUP=, which can do exactly what you want -- grouping by league, printing a header for the league, then printing the team data underneath

    rudy

Posting Permissions

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