Results 1 to 3 of 3

Thread: SQL query

  1. #1
    Join Date
    Jun 2006
    Posts
    6

    Unanswered: SQL query

    I'm not sure if this is the right place for this post, but maybe you guys can help. I have a table of products and a table with customers. Each customer offers up to 30 different products. I created a join table in access that pulls the customers and the list of products they offer. My question is, is there a way to construct a web table that shows the customer's name plus the list of products? I don't want to show the customer's name 30 times, just something like:

    Customer A Name
    Product 1
    Product 2
    Product 3
    and so on.

    I'm sure this is rudimentary but it's driving me nuts. any help is appreciated.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    what you're looking for is possible through two approaches --

    return the sorted results of the join to a scripting language (or a microsoft access report), and, while looping over the query result set, print the company name only when it changes

    alternatively, use data shaping, which is the spawn of the devil, and that's all i'll say about that

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    You have no business even trying to do this in SQL. The problem you have is a formatting issue, and SQL is designed for producing results, not formatting results. Formatting is the responsibility of your user-interface or reporting application (Access, Crystal, Active Reports...whatever).
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

Posting Permissions

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