
拆分与合并列值
htl258_Tony
这个作者很懒,什么都没留下…
展开
-
合并列值整理
数据:id col----- ------1 a1 b2 a2 b2 c 期望得到结果:id col------ -----------1 a,b2 a,b,c ------------------------------------------------原创 2009-03-15 23:10:00 · 1657 阅读 · 1 评论 -
拆分列值
declare @t table(a varchar(10),b varchar(20))insert @t select A, 1,2 union all select B, 1,2,9 union all select C, 5,6select a.a, b=substring(a.b, b.number, charindex(,, a.b +原创 2009-03-25 20:40:00 · 978 阅读 · 0 评论 -
A表字段加"/"转字符串后与B表字段加"/"连合后插入C表
例如: 表A 表B 表C sn1 contect1 sn2 conect2 help 1 你好 1 可以的 你好/很好/一般情况/是还可以/确实不错/可以的/你好嘛 2转载 2009-03-28 11:16:00 · 1176 阅读 · 0 评论 -
XML拆分合并列值学习整理
-->创建测试数据 if object_id(tb) is not null drop table tb go create table tb(id int identity primary key,name nvarchar(2)) go insert into tb(name) select 张三 union all select原创 2009-04-26 23:13:00 · 1484 阅读 · 0 评论 -
拆分列值心得
/*----------------------------------- Author : 分拆列值htl258(Tony)-- Date : 2009-09-10 01:38:02-- Version: Microsoft SQL Server 2008 (SP1) - 10.0.2531.0 (Intel X86) Mar 29 2009 10:27:原创 2009-09-09 07:38:00 · 3408 阅读 · 0 评论 -
特殊分拆列值应用实例
http://topic.youkuaiyun.com/u/20090918/23/4df5e104-f956-4e5c-8811-3317646a0878.html?11129declare @a table(thedate datetime ,val text) insert into @a select 2009-09-07, 星期一 08:00 起床刷牙洗脸 9:15 开始上班 12:00原创 2009-09-19 03:35:00 · 918 阅读 · 0 评论 -
字符串列取值相加减更新到新列(XML)
现在有表scores1 xt1 scores2 xt2 scores xt10 2,3,2,3 12 2,6,2,2 5.5 1,2,1,1.5 10 2,3,2,3 求这样结果scores1 xt1 scores2 xt2 scores xt10 2,3,2,3 12 2,6,2,2 11 2,4.5,2,2.55.5 1,2,1,1.5 10 2,3,2,3 7.75 1.5,2.5,原创 2010-04-04 15:12:00 · 1499 阅读 · 0 评论 -
SQL2000/2005字符串拆分为列表通用函数
---------------------------------------------------------------------------- Author : htl258(Tony)-- Date : 2010-04-28 02:00:28-- Version:Microsoft SQL Server 2008 (RTM) - 10.0.1600.22 (Int原创 2010-04-28 02:03:00 · 4174 阅读 · 4 评论