how to Switch using [CASE WHEN] in SELECT

  • I have a situation where I need to Switch after the reading the first 2. For example I whant result as 2. how to do it.

    declare @id int

    set @id=2

    select case when @id = 1 then 'One'

    when @id = 2 then 'Two; finish'

    when @id = 3 then 'Three'

    when @id = 2 then 'Double funky situation; do NOT comehere'

    end

    pls help thanks for you help

  • pl ingore this posting..thanks for you help.

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

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