I have data like this:
State ID
----- --
'CA' 5
'CA' 3
'MA' 2
'NH' 1
'NJ' 8
'NH' 9
For all the states it is putting apostrophes around the states.
I'm looking to somehow search by the state abbreviation but it won't let me search like this:
where state=''CA''
...because it's closing each apostrophe with the one after it.
I also tried this:
substring(state,charindex(''',state)+1),
charindex(''',state)-charindex(''',state),+1)