Craig Zirnheld
Craig Zirnheld

Reputation: 139

How to use proper syntax in where statement when updating a column where zip code columns are multiple

I am assigning salespeople to a table column based on a zip code. I want to include multiple zip codes in the where clause to set the sales person but don't know what the syntax is to do that. Here is what I have.

update      [Customer]
set         [Territory Code] = 1
where       [Post Code] = '40205' and '40206' and '40118'

This, of course, does not work.

Upvotes: 0

Views: 133

Answers (1)

radar
radar

Reputation: 13425

You will use IN

where [Post Code] in ( '40205', '40206', '40118') 

Upvotes: 2

Related Questions