SQL Query replacing value

  • I have a table which contains a visible field which can either hold 'y' or 'n'. What i want a query which will list the visible field with reverse value, i mean if the visible field contains 'Y' then the query should return 'N' and vice versa. Any clue?

  • select value=case(value) when 'y' then 'n'

    when 'n' then 'y' else '?' end

    from tablename

    HTH

    Ray Higdon MCSE, MCDBA, CCNA

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

    Ray Higdon MCSE, MCDBA, CCNA

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

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