4

我收到无效号码异常。MODinWHERE子句怎么用?我想根据 ID 更新偶数行或奇数行。

update employee  set respstr1 = 'EP' where mid = 7246 and (mod(id/2) = 1)
4

2 回答 2

11

mod的正确语法是

mod(id,2)
于 2013-10-07T04:55:36.327 回答
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

于 2013-10-07T04:57:24.073 回答