Query - View

  • Hi,

    I have a view that returns this data:

    ID ; Name ;

    10 Martha

    100 Martha2

    12 Martha3

    1000 Martha4

    ..................

    ..................

    I whant that if the ID is 10, then the Id returned become 0.

    Like this:

    ID ; Name ;

    0 Martha

    100 Martha2

    12 Martha3

    1000 Martha4

    ..................

    ..................

    How can i accomplish this?

    Thank you

  • Odd question, but why?

    SELECT

    CASE

    WHEN X = 10 THEN 0

    ELSE X

    END

  • Yap,

    The problem is how to put that on this:

    "SELECT TOP (100) PERCENT '1'+replace(rf.repf_id,'.','') as repf_id"

    This is my ID column

  • I found how to do it.

    Thank you very much

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

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