1.幾條數據中找到你好,並且顯示
第一條數據爲:你好嗎?
第二條數據:你好,阿姨!
第三條數據:hello,你好!
表名爲test,數據字段爲str
select * from test concat(',',`str`,',') like '%,你好,%';
得到的數據則爲第二條數據和第三條數據!
注:concat連接字符串。
1.幾條數據中找到你好,並且顯示
第一條數據爲:你好嗎?
第二條數據:你好,阿姨!
第三條數據:hello,你好!
表名爲test,數據字段爲str
select * from test concat(',',`str`,',') like '%,你好,%';
得到的數據則爲第二條數據和第三條數據!
注:concat連接字符串。