What is the meaning of comma in the following SQL statement (using MySQL)?
[...] LIKE '%,cat233,%'
What is the meaning of comma in the following SQL statement (using MySQL)?
[...] LIKE '%,cat233,%'
Aren't the commas just part of the string to be matched? e.g. "fred,bill,cat233,joe,harry" would match.
checking for cat233
which is in comma separated values.
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.
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"