sql query need help

  • hi all

    i need help from your side i have post query below .

    SELECT Id,Symptoms, replace (Symptoms,3,'Three')as symptons FROM temp table

    out put is this

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

    IdSymptoms symptons

    2003 2 2

    2004 4|3|2| 4|Three|2|

    30032 2

    20054|3|2| 4|Three|2|

    2007 3 Three

    i need out put

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

    IdSymptomssymptons

    2003 2two

    2004 4|3|2| four|Three|two|

    3003 2 two

    20054|3|2| four|Three|two|

    20073 Three

    Thanks & regards

    Rajnidas

  • There is no out of the box way to do this.

    Have a look here for some ideas.

    If you have only a few numbers to consider, there may be a simpler way to do it.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Add a few extra REPLACE?

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • If you have limited numbers add REPLACE or else create a user function.

  • riteshk123 (10/10/2014)


    ... or else create a user function.

    That's kind of vague advice.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

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

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