本文介绍了如何交换表中行的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在表格(Emp)中有一列如下 性别 M M M F F M F 现在我想将值从'M'更改为'F'和'F'更改为'M '。 我怎么能在一个查询中得到这个... 请帮助我... 解决方案 您好, 查找以下查询 更新 yourTable set 性别= case 性别 何时 ' F' 然后 ' M' ' M' 然后 ' F' end ; 希望这会对你有帮助。 Hi,I have a column in table (Emp) like belowGenderMMMFFMFNow i want to change the values from 'M' to 'F' and 'F' to 'M'.How can i get this in a single query..Please help me... 解决方案 Hi,Find query belowupdate yourTableset Gender = case Gender when 'F' then 'M' when 'M' then 'F' end;Hope this will help you. 这篇关于如何交换表中行的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-15 10:46