December 26th, 2008

Concatenate || (attach values), Part 4 of 4

If we have a table: ACCOUNTS_PAYABLE_TBL

Return VNDR_ID, INVN_ID, AMT_DUE, and then place ‘–> ‘ ahead of the NOTES and ‘ <–’ behind the NOTES column.

          SELECT VNDR_ID,
                 INVN_ID,
                 AMT_DUE,
                 '--> ' || NOTES || ' <--'
            FROM ACCOUNTS_PAYABLE_TBL;

Result Table:

 The trailing constant ‘ <–’ “floated” to the left behind the NOTES value
because the NOTES column is defined as VARCHAR.

Leave a reply

:mrgreen: :neutral: :twisted: :shock: :smile: :???: :cool: :evil: :grin: :oops: :razz: :roll: :wink: :cry: :eek: :lol: :mad: :sad: