Rather slow, but working method to include any of words:
(相当慢,但工作方法包括任何单词:)
SELECT * FROM mytable
WHERE column1 LIKE '%word1%'
OR column1 LIKE '%word2%'
OR column1 LIKE '%word3%'
If you need all words to be present, use this:
(如果您需要出现所有单词,请使用:)
SELECT * FROM mytable
WHERE column1 LIKE '%word1%'
AND column1 LIKE '%word2%'
AND column1 LIKE '%word3%'
If you want something faster, you need to look into full text search, and this is very specific for each database type.
(如果你想要更快的东西,你需要查看全文搜索,这对每种数据库类型都是非常具体的。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…