今天学习到一个知识点,在查询时如果比较字符串,会忽略结尾的连续空白,起始的空白不会忽略。于是:
select * from users where user='admin ';
会把user='admin'
的记录也选出。
In particular, trailing spaces are significant, which is not true for CHAR or VARCHAR comparisons performed with the = operator
今天学习到一个知识点,在查询时如果比较字符串,会忽略结尾的连续空白,起始的空白不会忽略。于是:
select * from users where user='admin ';
会把user='admin'
的记录也选出。
In particular, trailing spaces are significant, which is not true for CHAR or VARCHAR comparisons performed with the = operator