oracle 中:
update table t set t.status = 'x' where t.status='y'
在mysql中则需要使用
update table t inner join (select 'x' status from dual) c set t.status = c.status where t.status = 'y'
需要设置的列值
inner join (select 'x' status from dual) c中的c.status
where条件子句
t.status = 'y'
本文详细对比了Oracle和MySQL中更新语句的语法差异,通过实例展示了如何在MySQL中实现Oracle语句的功能。
1万+

被折叠的 条评论
为什么被折叠?



