Results 1 to 2 of 2

Thread: Concat

  1. #1
    Join Date
    Sep 2005
    Posts
    5

    Question Unanswered: Concat

    Hi
    I want to Concat Rows of a Column in a Table with One "Select" Order (I mean without use cursor)

    Example:

    Table1:
    Column1
    -----------
    'a'
    'b'
    'c'

    Result:
    'abc'

    Please answer me

    thanks alot

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    if you're using MySQL, use the GROUP_CONCAT function

    if you're using Sybase ASE, use the LIST function

    otherwise, a cursor is actually not a bad idea, because other database systems don't have a similar aggregate function
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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