Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MOD operator in where clause

Tags:

sql

oracle

I am getting an invalid number exception. How do you use MOD in WHERE clause? I am wanting to update even or odd rows based on ID.

update employee  set respstr1 = 'EP' where mid = 7246 and (mod(id/2) = 1)
like image 606
sunleo Avatar asked Dec 15 '22 05:12

sunleo


1 Answers

Correct syntax for mod is

mod(id,2)
like image 60
Chamal Pradeep Rajapakse Avatar answered Dec 17 '22 19:12

Chamal Pradeep Rajapakse