All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET技巧:正则表达式提取数字_[Asp.Net教程]
ASP.NET2.0自动搜索文件组成导航系统_.net资料_编程技术
HTML 5 预览(2)_[Html教程]
ASP.NET技巧:DataGridView常见问题_[Asp.Net教程]
使用javascript检测浏览器的相关特性_JavaScript技术_编程技术
ASP.NET2.0,保存密码框的小技巧_[Asp.Net教程]
在Web2.0下的十大AJAX安全漏洞以及成因_.net资料_编程技术
对PHP程序中的常见漏洞进行攻击_[PHP教程]
SQL循序渐进(24)嵌入SQL_[SQL,Server教程]
asp.net,2.0中不同web控件之间的相互调用_[Asp.Net教程]
Reading number is top 10 pictures
Embarrassing things comic collection2
胸部遭到偷窥的女人们
Other people's teacher VS my teacher
Chinese paper-cut grilles art appreciation4
Fury xp desktop theme
为什么别人说你是疯子
湖边的风景
yy365网站上的美女1
清纯性感的美眉2
美奂绝伦的风景
Download software ranking
致我们终将逝去的青春
Unix video tutorial1
虚拟机汉化软件
电车之狼R
Call Of Duty5
VC++6.0简体中文版
传奇私服架设教程
Kung.Fu.Panda.2
The Bermuda triangle1
天龙八部最新服务端
归海一刀 published in(发表于) 2014/2/3 6:35:28 Edit(编辑)
Sql server 如何得到汉字的声母_[SQL Server教程]

Sql server 如何得到汉字的声母_[SQL Server教程]

Sql server 如何得到汉字的声母_[SQL Server教程]

在sql中创建用户自定义拼音函数:
create function f_GetPy(@Str nvarchar(400))
returns nvarchar(4000)
as
begin
declare @strlen int,@re nvarchar(4000)
declare @t table(chr nchar(1) collate Chinese_PRC_CI_AS,letter nchar(1))
insert @t select '吖','A' union all select '八','B'
union all select '嚓','C' union all select '咑','D'
union all select '妸','E' union all select '发','F'
union all select '旮','G' union all select '铪','H'
union all select '丌','J' union all select '咔','K'
union all select '垃','L' union all select '嘸','M'
union all select '拏','N' union all select '噢','O'
union all select '妑','P' union all select '七','Q'
union all select '呥','R' union all select '仨','S'
union all select '他','T' union all select '屲','W'
union all select '夕','X' union all select '丫','Y'
union all select '帀','Z'


select @strlen=len(@str),@re=''
while @strlen>0
begin
select top 1 @re=letter+@re,@strlen=@strlen-1
from @t a where chr<=substring(@str,@strlen,1)
order by chr desc
if @@rowcount=0
select @re=substring(@str,@strlen,1)+@re,@strlen=@strlen-1
end
return(@re)
end
go
--测试
select dbo.f_GetPy('东莞市') as 东莞市,dbo.f_GetPy('ab中c国人') as 中国人


--以后查询的时候,就可以调用上面的函数来实现汉字模糊查询


select * from 表 where dbo.f_getpy(字段)='zgyh'



来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.