在SQL数据库中,按照英文首字母对数据库中的汉字进行筛选

来源:百度知道 编辑:UC知道 时间:2024/07/08 13:33:56
在SQL数据库中,按照英文首字母对数据库中的汉字进行筛选
比如:我点了“J”从数据库中表索出“金山”,“建行”之类的数据

Create Function RmGetPY(@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
'丌' 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
'他' unio