SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Comma seperated list from a select

    Hi:

    I have a multi-to-multi relationship.

    Code:
    Software
                1            Software #1
                2            Software #2
    
    Functions
                1            Function #1
                2            Function #2
    
    Software_Function
                1            1
                1            2
                2            2
    Is it possible some way to get a comma seperated list while getting ALL the functions for a software, say 1?


    Let's say I want to query all the function for "Software#1". So, Rather than getting different rows, can I get the data like "Function #1, Function #2"?


    Thanks
    ---------------------------
    Errors = Improved Programming.
    My Site

  2. #2
    Umm. PHP Guru....Naaaah jaswinder_rana's Avatar
    Join Date
    Jul 2004
    Location
    canada
    Posts
    3,193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Never mind. Got it.

    Posting link for others, just in case.

    http://www.4guysfromrolla.com/webtech/092105-1.shtml

    Thanks
    ---------------------------
    Errors = Improved Programming.
    My Site

  3. #3
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,215
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    thanks for posting the solution for others, that was nice of you

    that's why i love sitepoint forums

    aside: you should see how easy this is in mysql, with the GROUP_CONCAT function
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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