请问日本明星和韩国明星按字母查找,SQL应该怎么写,还有应该用什么控件来显示。有做过的,给点建议,代码能否分享一下,先谢谢各位大虾了,在线等。。
解决方案 »
- 怎样用TreeView控件做出电脑左侧任务栏一样的效果?
- asp.net2.0 中 treeview控件如何 点击文字后展开下级菜
- 一个非常难.又很麻烦的在gridview里显示数据的问题.
- 有三个列的表格,如何固定两端的列宽,中间列宽自动分配?
- asp.net中点击按键在后台代码中 如何执行.sql文件
- 如何改变项目名称
- DataGrid控件的添加,删除问题!
- 问个小问题,HtmalSelect的Value属性怎么没变化
- 我想在javascript语句中使用for each语句把form中的所有radio都变得不可用,不知怎么写
- 寻ASP.net中的打印解决方案(最好详细点)
- 如何获得POST请求的数据?
- 第一个简单的aspx 程序问题
http://www.kugou.com/top/singer/singertype_2_5.htm拜托各位了
group by 查询的数据
但是还有些按字查询的SQL不会写,日韩的,这个要按拼音的首字母发音,这种SQL该怎么写呢
select * from 表名 order by fun_getPY(明星名字字段)取汉字拼音首字母的存储过程
Create function fun_getPY
(
@str nvarchar(4000)
)
returns nvarchar(4000)
as
begin declare @word nchar(1),@PY nvarchar(4000) set @PY='' while len(@str)>0
begin
set @word=left(@str,1) --如果非汉字字符,返回原字符
set @PY=@PY+(case when unicode(@word) between 19968 and 19968+20901
then (
select top 1 PY
from
(
select 'A' as PY,N'驁' as word
union all select 'B',N'簿'
union all select 'C',N'錯'
union all select 'D',N'鵽'
union all select 'E',N'樲'
union all select 'F',N'鰒'
union all select 'G',N'腂'
union all select 'H',N'夻'
union all select 'J',N'攈'
union all select 'K',N'穒'
union all select 'L',N'鱳'
union all select 'M',N'旀'
union all select 'N',N'桛'
union all select 'O',N'漚'
union all select 'P',N'曝'
union all select 'Q',N'囕'
union all select 'R',N'鶸'
union all select 'S',N'蜶'
union all select 'T',N'籜'
union all select 'W',N'鶩'
union all select 'X',N'鑂'
union all select 'Y',N'韻'
union all select 'Z',N'咗'
) T
where word>=@word collate Chinese_PRC_CS_AS_KS_WS
order by PY ASC
)
else @word
end)
set @str=right(@str,len(@str)-1)
end return @PY end
http://topic.csdn.net/t/20061025/19/5109154.html
但是我不需要做下拉菜单因为我没有那么多的类型,我只要右边那一块,就是上面是A-Z字母,下面显示A-z显示的内容
不明白我意思的可以参加上面的网页
在录入人名的时候,使用js自动生成汉字的拼音首字母,
这个js函数见
http://blog.csdn.net/xuStanly/archive/2007/08/28/1761397.aspx但是多音字若与上下文不符,还得手动调整。