我有一个名字表,一列有名字,一列是姓。说我有“玛丽史密斯”这个名字。当我搜索“史密斯”或“玛丽史密斯”而不是“玛丽”时,我希望该行返回。如何为全文索引实现此目的?
答案 0 :(得分:0)
我认为这就是你所需要的:
WHERE surname = 'yoursearch' OR (name || ' ' || surname) = 'yoursearch'
两个
WHERE surname = 'Smith' OR (name || ' ' || surname) = 'Smith'
WHERE surname = 'Mary Smith' OR (name || ' ' || surname) = 'Mary Smith'
返回Mary Smith但
WHERE surname = 'Mary' OR (name || ' ' || surname) = 'Mary'
没有