SQL question / Multiple rows output in one line

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dirk

    SQL question / Multiple rows output in one line


    How can I do this?

    Table A

    A B
    ---------------------
    John New York
    John Miami
    John ...
    Max London

    I want to do a SELECT which outputs

    John, New York Miami ... in one Line

    How can I do this?
    Can



    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
  • mcstock

    #2
    Re: SQL question / Multiple rows output in one line

    write a stored function that does a PL/SQL loop to concatenate the values,
    call the function within the select column list

    SELECT id, name, cities_list(id)
    from ...
    --
    Mark C. Stock
    email mcstock -enquery(dot)com

    (888) 512-2048

    "dirk" <dirk@acker.com wrote in message news:3fa923f7_1 @127.0.0.1...
    >
    How can I do this?
    >
    Table A
    >
    A B
    ---------------------
    John New York
    John Miami
    John ...
    Max London
    >
    I want to do a SELECT which outputs
    >
    John, New York Miami ... in one Line
    >
    How can I do this?
    Can
    >
    >
    >
    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet
    News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000
    Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
    =---


    Comment

    Working...