2 years ago

#34982

test-img

ANas200

Using the IN operator to find a list of values containing special characters

I need to find data with a list of values using the IN operator but one lookup value in my list contains single quote:

SELECT * FROM Table WHERE Errorcode IN ( 'subsriber's phone number is blank.', 'Primary address cannot be PO Box.', 'Address is invalid.', 'City/ST/Zip Code mismatch.' )

Can I use a SUBSTRING function to truncate the first lookup value? It HAS to be included in order to pull the correct number of rows. The ErrorCode column is a VARCHAR (max) datatype and null is permitted.

sql

list

operator-keyword

0 Answers

Your Answer

Accepted video resources