如果在MOD
子句中使用WHERE
获取无效数字异常,则希望根据ID更新偶数行或奇数行。
update employee set respstr1 = 'EP' where mid = 7246 and (mod(id/2) = 1)
答案 0 :(得分:8)
mod的正确语法是
mod(id,2)
答案 1 :(得分:1)
试
update employee set respstr1 = 'EP' where mid = 7246 and (mod(id,2) = 1)
有关详细信息,请参阅以下链接 http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions088.htm