前往顾页
以后地位: 主页 > 收集编程 > .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

顶一下
(0)
0%
踩一下
(0)
0%
------分开线----------------------------
标签(Tag):数据库 SQLServer SQLServer数据库 Sqlserver2008
------分开线----------------------------
颁发评论
请自发遵循互联网相关的政策法规,严禁公布色情、暴力、革命的谈吐。
评价:
神色:
考证码:点击我更换图片
猜你感兴趣