sql - How to query star (*) character in a field in where clause for mysql -
i want query table field contains star (*) character could't find valuable answer. tried below
where fieldname regexp '\*'
there solutions using 'like' keyword wanna know way uses 'regexp' keyword.
thanks in advance.
you need escape backslash 1 more time since single backslash inside double or single quotes considered escape sequence.
where fieldname regexp '\\*'
or
use character class.
where fieldname regexp '[*]'
Comments
Post a Comment