开发中容易写错的一条SQL语句

时间:2023-03-09 16:21:10
开发中容易写错的一条SQL语句

select * from tableName where name = like '%糖糖%'

出错的地方:name后面有=和like

出错的原因:复制过来的,其它地方是=,没有删掉直接加了like

报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIKE CONCAT(CONCAT('%', '  1470622825427 '),'%')

IT技术和行业交流群 417691667