Will the following query evaluate to true (1), false (0), or NULL? SELECT '%' LIKE ' % ';
the answer provided is
The '%' character is matched by '%', but not by the space characters surrounding it, so the expression evaluates to false. +----------------+ | '%' LIKE ' % ' | +----------------+ | 0 | +----------------+
but i thought % can match zero or more characters? so % can match % + Spaces? or does characters nt include wildcards?
UPDATE:
oh but if the comparison happens the other way arnd it is true ... hmm ...
SELECT ' % ' LIKE '%';
Any non-NULL string is matched by the '%' metacharacter, so the expression evaluates to true. +----------------+ | ' % ' LIKE '%' | +----------------+ | 1 | +----------------+