December 30, 2010 at 9:40 am
Hello Everyone
I am working on an Update statement. That will update a bit column only if the RowID is an Odd number. The RowID is a numeric value starting at number 1 and going thru say 100
My question is this:
How can I determine if the RowID is an Even or Odd number?
I can do this update a different way, but I am trying to learn how to do it using the RowID value
Thanks in advance
Andrew SQLDBA
December 30, 2010 at 9:44 am
December 30, 2010 at 9:46 am
UPDATE mytable
SET column1 = 'test'
WHERE ABS(myid) % 2 = 1
Seems Dave was quicker off the draw than me 😉
December 30, 2010 at 10:10 am
Thanks Guys
That worked perfectly. I don't know why I did not think of using that. Maybe I am getting too old for this.
Andrew SQLDBA
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply