按首字母查所有城市.net
来源:互联网 发布:09年总决赛科比数据 编辑:程序博客网 时间:2024/06/05 06:38
create function f_GetPy(@str nvarchar(4000))
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 into @t(chr,letter)
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 * from city where left(dbo.f_GetPy(cityname),1) = 't'
- 按首字母查所有城市.net
- 城市列表按首字母自动排列
- OC 获取城市首字母
- Android 城市列表ListView 之 按首字母分组
- Android 城市列表ListView 之 按首字母分组
- Android 城市列表ListView 之 按首字母分组
- 读取xml 点击城市首字母出来城市
- 根据城市首字母进行分类,区分多音字,获取城市首字母
- 关于城市列表按首字母排序、分组及查找的一个解决方案(mysql端)java
- Android开发--全国各城市列表并按首字母排序加快速定位
- 城市列表-根据拼音首字母排序
- 城市列表-根据拼音首字母排序
- Android 根据首字母给城市排序
- 根据城市名称的首字母,将城市分类
- 全国所有城市SQL
- .net 首字母大小写转换
- 中国气象局所有城市代码
- 天气接口所有城市代码
- 男人女人
- java正则
- 线程定时器设计4
- 使用SQL Server 数据库基础
- 关于ORACLE 的优化方案
- 按首字母查所有城市.net
- Symbian中singleton的实现
- 公司维护网站时常用的sql语句.net
- Sql server 2000 远程访问数据库
- 利用winpe制作可启动光盘,执行自动硬盘分区
- epoll编程实例
- 一篇不错的讲解Java异常的文章
- REPLACE注意事项
- linux的运行模式:runlevel