Replace values in column based on condition

  • Hi,

    I have a column which has numbers 1, 2, 3. I want to replace the value in this column.

    Say if its 1 then replace it by 'one' , 2 then replace it by 'two'. And i want to do this in a select statement. I dont want it be changed in my table. i need this change only in my result set.

    Thanks,

    Ashu

  • ashu (2/20/2009)


    Hi,

    I have a column which has numbers 1, 2, 3. I want to replace the value in this column.

    Say if its 1 then replace it by 'one' , 2 then replace it by 'two'. And i want to do this in a select statement. I dont want it be changed in my table. i need this change only in my result set.

    Thanks,

    Ashu

    Have you looked up the CASE statement in Books Online? That would be a good place to start.

  • Thank you, It worked! 🙂

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

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