Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004

    Question Unanswered: SELECT + insert a delimiter between fields

    I'm trying to run a select statement from a single db table. I'm going to take my results and put it in to an Excel spreadsheet. The problem is that some of the records have empty fields in the table, so the spreadsheet turns out all screwed up. Is it possible to insert a comma or some other kind of delimiter between each field in each record? Or is there another way to do this?


    select last_name, first_name, ssn, dob from employee

    returns the following:

    Jones Frank 123-45-6789 02/09/1956
    Smith Sue 04/19/1980
    Simmons 123-45-1234 08/10/1970

    I'd like to have it return this:

    Jones, Frank, 123-45-6789, 02/09/1956
    Smith, Sue, , 04/19/1980
    Simmons, , 123-45-1234, 08/10/1970

  2. #2
    Join Date
    Feb 2004
    select concat(last_name, ',', first_name, ',', ssn, ',', dob) from employee

    ... or try '\t' instead of ',' if you want a TAB as delimiter.

    see at

    w. :-)

Posting Permissions

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