select * from nrpt_book t where concat(t.name,t.author) like '%平%';
结果是不论name字段还是author字段只要其中包含平这个字的记录 都被查出来
本文介绍了一种使用SQL进行模糊查询的方法,通过concat函数将两个字段连接起来,并使用like语句搜索包含特定字符的记录。
select * from nrpt_book t where concat(t.name,t.author) like '%平%';
结果是不论name字段还是author字段只要其中包含平这个字的记录 都被查出来
3435
1988

被折叠的 条评论
为什么被折叠?