表artists
id | name
---------
1 | kida
2 | capital t
3 | taylor swift
select replace(name, ' ', '') from artists where match(`name`) against ('taylorswift' IN BOOLEAN MODE) limit 1
如果我运行此查询它没有显示结果,但我想用null替换空格并显示Taylor Swift作为结果。这可能吗?
答案 0 :(得分:0)
那是因为taylorswift != taylor swift
。您的主要想法是显示name
没有空格。你可以这样做
select replace(name, ' ', '') as name
from artists
where match(`name`) against ('taylor swift' IN BOOLEAN MODE)
limit 1;