update student set colname='N' where colname='Y' update student set colname='Y' where colname='N'
假如还有其它值: update yourtable set colname=case colname when 'n' then 'y' when 'y' then 'n' where colname in('n','y')
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
update student set colname='Y' where colname='N'
update yourtable set colname=case colname when 'n' then 'y'
when 'y' then 'n' where colname in('n','y')
when 'N' then 'Y'
else 字段名 end
如果有大小写,就用:
update tb set 字段名=case upper(字段名) when 'Y' then 'N'
when 'N' then 'Y'
else 字段名 end