- #1
- 7,122
- 10,775
Hi All,
I am trying to do an SQL query for records containing a certain character, say, c , in 'field'
I think if the character c is at the beginning, we use :
Select ... from table
where field like 'c % ' , where % is a wildcard.
Similar for cases where the character is at the end, i.e., we would use :
Select ... from table
where field like '% c '.
But if the character c was somewhere in the middle , would we use :
Select ... from table
where field like '% c % ' ?
EDIT: I assume the last choice, '% c % ' covers all cases, since % may stand for an empty string.
Is this correct?
Thanks.
I am trying to do an SQL query for records containing a certain character, say, c , in 'field'
I think if the character c is at the beginning, we use :
Select ... from table
where field like 'c % ' , where % is a wildcard.
Similar for cases where the character is at the end, i.e., we would use :
Select ... from table
where field like '% c '.
But if the character c was somewhere in the middle , would we use :
Select ... from table
where field like '% c % ' ?
EDIT: I assume the last choice, '% c % ' covers all cases, since % may stand for an empty string.
Is this correct?
Thanks.
Last edited: