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
 Hello! Only get even values of column

Author  Topic 

Dasman
Yak Posting Veteran

79 Posts

Posted - 2014-03-15 : 12:03:05
Hello All,

Say my dataset has a column with numbers 1-15. Those numbers are attached to other information.

CUSTID Name
1 Jim
2 Pat
3 Mary
4 Sally
5 Jane

How can I pull only even customer IDs?

Will something like this work?

SELECT * FROM TABLENAME
WHERE CustomerID/2 = 'Even/Int'

==========================
Pain is Weakness Leaving the Body.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2014-03-15 : 12:13:28
CUSTID % 2 = 0


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -