惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Exploit Database - CXSecurity.com
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Spread Privacy
Spread Privacy
Hacker News - Newest:
Hacker News - Newest: "LLM"
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
S
Security Affairs
Help Net Security
Help Net Security
Simon Willison's Weblog
Simon Willison's Weblog
N
News and Events Feed by Topic
P
Palo Alto Networks Blog
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
P
Proofpoint News Feed
N
News and Events Feed by Topic
C
Cyber Attacks, Cyber Crime and Cyber Security
TaoSecurity Blog
TaoSecurity Blog
T
Tor Project blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V
Visual Studio Blog
F
Fortinet All Blogs
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
M
MIT News - Artificial intelligence
T
Threatpost
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
N
News | PayPal Newsroom
P
Privacy & Cybersecurity Law Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Cyberwarzone
Cyberwarzone
雷峰网
雷峰网
云风的 BLOG
云风的 BLOG
量子位
Google DeepMind News
Google DeepMind News
O
OpenAI News
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
F
Full Disclosure
B
Blog
Cloudbric
Cloudbric
MyScale Blog
MyScale Blog
阮一峰的网络日志
阮一峰的网络日志

博客园 - 爱东东

解决SQLServer2005孤立用户问题 RJ45做法 Java.net3DES差异及互通 win下安装MRTG MySQL和SQLServer互转 AspNetUrl重写2级域名 解决XP安装了SP3后无法安装更新补丁的方法 QQ代码 工作流例子 关于推广网络游戏《传奇3》计划书 几个很受启发的创意营销经典 软件开发人员创业做什么方向好?自己的疑问! ascentSVN地址备忘 ascent服务器架设新手教程 魔兽世界GM技能表 解决win2003下delphi出现内存读写错误 魔兽世界高法伤技能列表 汇编算术运算指令 8088 汇编速查手册
MySQL获取首字母拼音方法
爱东东 · 2008-07-07 · via 博客园 - 爱东东

CREATE TABLE `tbl_py` (
`PY` char(1) character set utf8 NOT NULL, 
`HZ` char(1) NOT NULL default '',         
PRIMARY KEY  (`PY`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk;
insert into tbl_py values
('A','骜'),
('B','簿'),
('C','错'),
('D','鵽'),
('E','樲'),
('F','鳆'),
('G','腂'),
('H','夻'),
('J','攈'),
('K','穒'),
('L','鱳'),
('M','旀'),
('N','桛'),
('O','沤'),
('P','曝'),
('Q','囕'),
('R','鶸'),
('S','蜶'),
('T','箨'),
('W','鹜'),
('X','鑂'),
('Y','韵'),
('Z','咗');
DELIMITER $$

DROP FUNCTION IF EXISTS `f_hzcode`$$

CREATE FUNCTION `f_hzcode`(
 words   varchar(255)) RETURNS  char(1) CHARSET utf8
BEGIN  
  declare fpy char(1);  
  declare pc char(1);  
  declare cc char(4);  
  set @fpy = UPPER(left(words,1));  
  set @pc = (CONVERT(@fpy   USING   gbk));  
  set @cc = hex(@pc);  
  if @cc >= "8140" and @cc <="FEA0" then 
    begin  
      select PY from tbl_py where hz>=@pc limit 1 into @fpy;
    end;  
  end   if;  
  Return   @fpy;  
  END$$

DELIMITER ;