我在Oracle中的语句是这样的
update table1 a set(a1,a2,a3,a4) = (select b1,b2,b3,b4 from table2 b where b.id = a.unit_id) where a.enabled_flag='Y'
直接拿到mysql中执行时报错了,就报set的等号这里的语法错误?
这里mysql不是这样写的吗?
mysql中应该怎么写?
------解决方案--------------------
- SQL code
update table1 a , table2 b set a1=b1,a2=b2,a3=b3,a4=b4 where b.id = a.unit_id and a.enabled_flag='Y'