在客户端有一文本框,在文本框中输入人姓名的每个字的拼音的首字母,然后在现在一个div里显示出
相符合的姓名!比如:我输入z,下面把拼音首字母为z的全显示出来,比如:张三、张四、站六、只只
都显示出来,这如何做的呢?再一步,比如一个人的姓名叫“刘备”我只要输入lb就能搜索出来
当然输入lb的时候名字叫做“刘备龙”的也能显示出来,请高手赐教了,本人菜鸟级,最好贴点关键代码
小生感激不敬!!
create function [dbo].[f_ch2py](@chn nchar(1))
returns char(1)
as
begin
declare @n int
declare @c char(1)
set @n = 63
select @n = @n +1,
@c = case chn when @chn then char(@n) else @c end
from(
select top 27 * from (
select chn =
'吖' union all select
'八' union all select
'嚓' union all select
'咑' union all select
'妸' union all select
'发' union all select
'旮' union all select
'铪' union all select
'丌' union all select --because have no 'i'
'丌' union all select
'咔' union all select
'垃' union all select
'嘸' union all select
'拏' union all select
'噢' union all select
'妑' union all select
'七' union all select
'呥' union all select
'仨' union all select
'他' union all select
'屲' union all select --no 'u'
'屲' union all select --no 'v'
'屲' union all select
'夕' union all select
'丫' union all select
'帀' union all select @chn) as a
order by chn COLLATE Chinese_PRC_CI_AS
) as b
return(@c)
end
浙公网安备 33010602011771号