update student set colname=case colname when  'n' then 'y'
                              when  'y' then 'n' end

解决方案 »

  1.   

    update student set colname='N' where colname='Y'
    update student set colname='Y' where colname='N'
      

  2.   

    假如还有其它值:
    update yourtable set colname=case colname when  'n' then 'y'
                    when 'y' then 'n' where colname in('n','y')
      

  3.   

    update tb set 字段名=case 字段名 when 'Y' then 'N'
                                     when 'N' then 'Y'
                                     else 字段名 end
    如果有大小写,就用:
    update tb set 字段名=case upper(字段名) when 'Y' then 'N'
                                            when 'N' then 'Y'
                                            else 字段名 end