返回首页
当前位置: 主页 > 网络编程 > .Net实例教程 >

sql 2005 全文检索代码

时间:2012-06-28 20:04来源:知行网www.zhixing123.cn 编辑:麦田守望者

select * from dbo.EB_Admin_Company
where contains(china_full_name,'"蘇" or "苏州"')

select * from dbo.EB_Admin_Company
where contains(china_full_name,'苏州')

--位置相近
select * from dbo.EB_Admin_Company
where contains(eng_full_name,'"a" near "Ch*"')

--衍生字
select * from dbo.EB_Admin_Company
where contains(eng_full_name,'formsof (inflectional,flag)')

--给字串加权计分
select * from dbo.EB_Admin_Company
where contains(china_full_name,'isabout (苏州 weight(0.2),蘇 weight(0.4))')

--freetext
select * from dbo.EB_Admin_Company
where freetext(china_full_name,'苏州 蘇州')

--containstable
select *,a.* from dbo.EB_Admin_Company inner join
containstable(china_full_name,' 苏州 or 蘇州 ')a on companyId=a.[key]
order by a.rank desc

--freetexttable
select *,a.* from dbo.EB_Admin_Company inner join
freetexttable (china_full_name,eng_full_name,' 苏州 蘇州 ')a on companyId=a.[key]
order by a.rank desc

------分隔线----------------------------
标签(Tag):数据库 SQLServer SQLServer数据库 Sqlserver2008
------分隔线----------------------------
推荐内容
猜你感兴趣