Reputation: 119
What is the meaning of comma in the following SQL statement (using MySQL)?
[...] LIKE '%,cat233,%'
Upvotes: 0
Views: 1876
Reputation: 4686
Looks like it would just match the comma as well; so:
Matches:
"My text,cat233,some other stuff"
"My text ,cat233, some other stuff"
"My text,cat233,"
",cat233,"
Doesn't match:
"My text cat233 some other stuff"
"My text cat233, some other stuff"
"My text, cat233, some other stuff"
Upvotes: 1
Reputation: 62369
It has no special meaning. It just look for string ,cat233,
with 0 or more character in front and 0 or more character after it.
Upvotes: 1
Reputation: 11155
checking for cat233
which is in comma separated values.
Upvotes: 2
Reputation: 3266
Aren't the commas just part of the string to be matched? e.g. "fred,bill,cat233,joe,harry" would match.
Upvotes: 3