i use the code above to select ItemNum w/ even number.. but the problem is how about 8 and above?Code:"Select * from Table WHERE ItemNum=2 OR ItemNum=4 OR ItemNum=6"
the same w/ the odd number
what should I do?
Printable View
i use the code above to select ItemNum w/ even number.. but the problem is how about 8 and above?Code:"Select * from Table WHERE ItemNum=2 OR ItemNum=4 OR ItemNum=6"
the same w/ the odd number
what should I do?
Which database are you using? Oracle and SQL Server have MATH functions in SQL.
http://www.java2s.com/Code/Oracle/Nu...ctions/MOD.htm
Mod operator is written as % (percentage) in T-SQL.
vb Code:
"Select * from Table WHERE ItemNum > 0 AND ItemNum MOD 2 = 0"