在SQL server2012中搜索FuLLText [英] FuLLText Search in SQL server2012
本文介绍了在SQL server2012中搜索FuLLText的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的数据库中的列值是'马德拉斯大学',但用户在自动完成框中传递'马德拉斯大学'。什么是他通过'马德拉斯大学'时可以找到'马德拉斯大学'的方式。
提前谢谢
Lohieth
Hi,
The column value in my database is 'University of Madras', But the user passes 'Madras University' in the Auto-complete box. what is the possible way that he could find 'University of Madras' when he passes 'Madras University'.
Thanks in advance
Lohieth
推荐答案
解决方案1:以下代码将帮助您(无全文搜索)
假设,我的数据库中的列值是'University of Madras',列名是'University_Name',tableName是StudentDetails
Solution 1: Following piece of code will help you out (without Full Text Search)
Suppose, column value in my database is 'University of Madras' and name of column is 'University_Name' and tableName is StudentDetails
select * from StudentDetails where University_Name like '%Madras%' and University_Name like '%University%'
解决方案2 以下代码将帮助您(使用全文搜索)
Solution 2 Following piece of code will help you out (with Full Text Search)
SELECT * FROM StudentDetails WHERE contains(University_Name,'Madras and University')
这篇关于在SQL server2012中搜索FuLLText的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文