Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 filter ID by even number

Author  Topic 

allan8964
Posting Yak Master

249 Posts

Posted - 2012-10-23 : 15:37:29
Hi there,

I need to update a table on even ID number:

update table1
set col1='ABC'
where tableId = even number

thanks in advance.

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-10-23 : 15:40:14
[code]update table1
set col1='ABC'
where tableId%2 = 0[/code]
Go to Top of Page

allan8964
Posting Yak Master

249 Posts

Posted - 2012-10-23 : 15:44:36
Yes, I felt it won't be hard but just forgot operation sign % for intteger division!
Thank you so much, sunitabeck.
Go to Top of Page
   

- Advertisement -