select from student where 1=1 and like studentName 二; 这个sql语句哪错了
这个SQL语句有两个错误:
-
缺少通配符
%,在使用LIKE运算符时需要用%表示通配符。正确的写法是:LIKE '%二%'。 -
缺少关键字
LIKE,在使用LIKE运算符时需要加上关键字LIKE。正确的写法是:studentName LIKE '%二%'。
所以,正确的SQL语句应该是:SELECT * FROM student WHERE 1=1 AND studentName LIKE '%二%';
原文地址: https://www.cveoy.top/t/topic/iHFN 著作权归作者所有。请勿转载和采集!