Comma Separated Values

  • I need deptno and against/beside it comma separated ename's for join dept.deptno=emp.deptno in a single query. Thanks in advance.

  • ???

    select cast(deptno as varchar) + ',' + ename

    ---------------------------------------
    elsasoft.org

  • What language is this?

  • Hi Koneru,

    U gotta give table definitions if any, data insertion scripts (test data),the query you are writing, the ouptput and the desired output.. for any kind of help here.

    ---------------------------------------------------------------------------------

  • Koneru Murli Krishna (1/22/2007)


    I need deptno and against/beside it comma separated ename's for join dept.deptno=emp.deptno in a single query. Thanks in advance.

    Please see the link in my signature below... we just like to test our code against your data before posting anything. Or not... in which case most folks will simple say "The following article should help you figure it out..."

    http://www.sqlservercentral.com/articles/Test+Data/61572/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply