find_in_set函數

find_in_set查詢字段中是否包含指定字符串時的用法如下:

select * from table where find_in_set(‘1’,name) = 0

運行結果:返回所有不包含1的name字段。

select * from table where find_in_set(‘1’,name) > 0

運行結果:返回所有包含1的name字段。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章