REPLACE AND UPPER CASE

  • Given the phrase "A,b,B,a,c,b" is there a way to use my REPLACE keyword a return the string:

    103!3@107@2!5#3@

    instead of: 2!3@3@2!5#3@ ?

    SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(

    Place, 'a','2!'), 'b','3@'), 'c','5#'),

    'A','103!'), 'B','107@'), 'C','109#')

    FROM names

  • SQLalchemy (6/23/2014)


    Given the phrase "A,b,B,a,c,b" is there a way to use my REPLACE keyword a return the string:

    103!3@107@2!5#3@

    instead of: 2!3@3@2!5#3@ ?

    SELECT REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(

    Place, 'a','2!'), 'b','3@'), 'c','5#'),

    'A','103!'), 'B','107@'), 'C','109#')

    FROM names

    Collation would do this.

    Find the difference in these two columns.

    SELECT [TextNoCoolation] = replace(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(

    'A,b,B,a,c,b' , 'a','2!'), 'b','3@'), 'c','5#'), 'A','103!'), 'B','107@'), 'C','109#'),',','')

    ,

    [TextwithCoolation] = replace(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(

    'A,b,B,a,c,b' COLLATE SQL_Latin1_General_CP1_CS_AS, 'a','2!'), 'b','3@'), 'c','5#'), 'A','103!'), 'B','107@'), 'C','109#'),',','')

Viewing 2 posts - 1 through 1 (of 1 total)

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