MySQL 喜歡多個值 - MySQL Like multiple values

問題:

I have this MySQL query.我有這個 MySQL 查詢。

I have database fields with this contents我有包含此內容的數據庫字段

sports,shopping,pool,pc,games 
shopping,pool,pc,games 
sports,pub,swimming, pool, pc, games   

Why does this like query does not work?爲什麼這樣的查詢不起作用? I need the fields with either sports or pub or both?我需要有運動場或酒吧或兩者兼而有之的場地?

SELECT * FROM table WHERE interests LIKE ('%sports%', '%pub%')

解決方案:

參考一: https://en.stackoom.com/question/HVNT
參考二: https://stackoom.com/question/HVNT
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章