SQL % Sign issues

I have a table where an organization is identified by a client number.  For some of our searches, we must combine these client numbers within an IN statement to get combined results (see below):

Single client data set:
select *
from table
where client number=12345

Client chain data set:
select *
from table
where client number in (12345,22345,32345)

However, within the database, we have previously used the % sign as an identifier for ALL locations within a chain.

Where client number in (12345,22345,32345)

This works just fine


Where client number in (%) does not work.  The correct syntax is WHERE client number in ('%')

also WHERE client number in ('12345,22345,32345') does not work - the apostrophes throw it off.

I would rather not hard code each of the % to a list as we add and remove locations within the chain from time to time.

Any suggestions on how to work around this?
Who is Participating?
WHERE client number in ('12345','22345','32345')
simplyfemalesAuthor Commented:
DOH!  I should have seen that.  If I could give extra credit, I would.

Any time, its an easy mistake
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.