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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News and Events Feed by Topic
N
News | PayPal Newsroom
SecWiki News
SecWiki News
P
Privacy International News Feed
T
Troy Hunt's Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
L
LINUX DO - 热门话题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Latest
Security Latest
AWS News Blog
AWS News Blog
S
Secure Thoughts
W
WeLiveSecurity
H
Heimdal Security Blog
T
Threat Research - Cisco Blogs
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
G
GRAHAM CLULEY
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
Cisco Talos Blog
Cisco Talos Blog
雷峰网
雷峰网
Cloudbric
Cloudbric
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
Latest news
Latest news
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
H
Help Net Security
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
博客园 - 叶小钗

博客园 - antony.net

移动版网页自动缩放问题 2011年国内五款值得关注网店系统 Enterprise Architect 7 入门教程大全 Enterprise Architect 业务过程建模 不同浏览器处理后退的一些异同 - antony.net - 博客园 23个.NET开源项目 js代码库 table css 固定表头 - antony.net Hash Tables in Javascript 在非UI线程中改变UI控件属性的通用方法 RSClientPrint打印 统计sql语句 文档格式批量转换(doc,txt,pdf等) 了解HTTP Headers的方方面面 XmlSerializer 常见问题疑难解答 webservices 水晶报表 - antony.net - 博客园 Build a Custom RadioButton Cell and Column for the DataGridView Control .NET 2.0 - WinForm Control - DataGridView 编程36计(二)
mysql 存储过程 游标
antony.net · 2010-12-24 · via 博客园 - antony.net

DELIMITER $$

DROP PROCEDURE IF EXISTS `SPLIT_SUB_STR0`$$

CREATE DEFINER=`admin`@`%` PROCEDURE `SPLIT_SUB_STR0`(INOUT str VARCHAR(1000) , split0 VARCHAR(1) ,OUT split VARCHAR(20))
BEGIN
 DECLARE  c INT;
 SET c=0;
SET c = LENGTH(SUBSTRING_INDEX(str,split0,1));
SET split = SUBSTRING(str, 1, c);
SET str = SUBSTRING(str, c + 2 );
    END$$

DELIMITER ;

DELIMITER $$

DROP PROCEDURE IF EXISTS `test`$$

CREATE DEFINER=`admin`@`%` PROCEDURE `test`()
BEGIN
 DECLARE  c INT;
#目标字符串
SET @a = '1,,3,4,5,6,12';
# 分隔符
SET @c = ',';
# 存储风格后的字符串
SET @b = '';
REPEAT
    # 调用上面的存储过程
    CALL SPLIT_SUB_STR0(@a, ',', @c);
    #将取得的字符串拼接,测试用
    
     SET @b =CAST(@b AS SIGNED INTEGER) + CAST(@c AS SIGNED INTEGER) ;
#当目标字符串为空时,停止循环
UNTIL @a = ''
END REPEAT;
# 查看结果
SELECT @a, @c, @b;
 
 
    END$$

DELIMITER ;