Will the following query evaluate to true (1), false (0), or NULL? SELECT '%' LIKE ' % ';
제공하는 대답은MySQL의 비교 및 '%'
The '%' character is matched by '%', but not by the space characters surrounding it, so the expression evaluates to false. +----------------+ | '%' LIKE ' % ' | +----------------+ | 0 | +----------------+
입니다하지만 난 %가 제로 이상의 문자를 일치시킬 수 있습니다 생각? 그래서 %는 % + Spaces와 일치 할 수 있습니까? 또는 문자 nt는 와일드 카드를 포함합니까?
는UPDATE :
오하지만 비교가 발생하는 경우 다른 방법이 흠 ... 사실 arnd ...
SELECT ' % ' LIKE '%';
Any non-NULL string is matched by the '%' metacharacter, so the expression evaluates to true. +----------------+ | ' % ' LIKE '%' | +----------------+ | 1 | +----------------+