Results 1 to 2 of 2

Thread: Concat Query

  1. #1
    Join Date
    Jun 2014
    Posts
    1

    Unanswered: Concat Query

    Hi All,
    I need one sql query to merge two columns , at the time of merging i need to insert "." between the two columns.

    if my second column is blank , the "." not needed in the output.

    The example mentioned below for your ready referce

    Col1 Col2 - Otuput Needed
    1100 IICI 1100.IICI
    1100 IBSI 1100.IBSI
    1200 1200
    1300 1300
    1400 SCIB 1400.SCIB

    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    How about this?
    (Not tested.)

    Code:
    SELECT Col1 , Col2
         , Col1 || IF(Col2 = '' , '' , '.' || Col2) AS "Otuput Needed"
     FROM  <your table>
    ;

Posting Permissions

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