I have a varchar
column that had some nvarchar
data inserted, so I now have records that contain data such as '? ???'
select * from table where EnglishName LIKE '%[? ]%'
Returns everything, and other variations of LIKE '[? ]'
don't return the data I'm after.
How can I select records that ONLY contain Question marks, and Optionally contain a Space?
'??' - return
'? ?' - return
' ?' - return
'? chen' - don't return
' ' - don't return
' chen' - don't return
Use an additional predicate to filter out non
?
or space characters:The above will also select records containing just spaces. If you want to filter these records out as well, then simply use: