日期:2014-05-18  浏览次数:20467 次

好久没散分了,最近运气差,散分冲冲晦气!!!
西安的天气有点过分了

------解决方案--------------------
传说中的沙发。
------解决方案--------------------
oh.给分。
------解决方案--------------------

------解决方案--------------------
擦,手还是那么快
------解决方案--------------------
西安,听说有一种叫馍的东西..

------解决方案--------------------

------解决方案--------------------
路过。
------解决方案--------------------

------解决方案--------------------

------解决方案--------------------

------解决方案--------------------
西安也是个热的城市

------解决方案--------------------
OK,飘过路过,不能错过、、
------解决方案--------------------
西安天气不好吗?涩郎最近在忙什么呢?
------解决方案--------------------
有什么晦气的,讲给我们听听,让我们也高兴下。
------解决方案--------------------
探讨
西安的天气有点过分了

------解决方案--------------------

------解决方案--------------------
全中国的天气都不正常
------解决方案--------------------
接。。。
------解决方案--------------------
SF不热?
------解决方案--------------------

------解决方案--------------------
charindex(' ',[CODE2]+' ',b.P2)+1 
from 
test a 
join 
T b 
on 
a.id=b.id 
where 
charindex(' ',[CODE2]+' ',b.P2)>0
)
select 
a.id,
a.CODE1,
name=substring(a.[CODE2]+' ',b.P1,b.P2 - b.P1 - 1) 
from 
test a 
join 
T b 
on 
a.id=b.id 
order by 
1
/*
id CODE1 name
--------------------------
1 AA AA
1 AA BB
1 AA CC
2 BB FF
2 BB EE
2 BB DD
*/

--> 测试数据:[A1]
if object_id('[A1]') is not null 
drop table [A1]
create table [A1](
[编码] varchar(2),
[内容] varchar(1)
)
insert [A1]
select '01','a' union all
select '02','b' union all
select '03','c' union all
select '04','d' union all
select '05','e'
--> 测试数据:[B2]
if object_id('[B2]') is not null 
drop table [B2]
create table [B2](
[id] int,
[内容] varchar(11)
)
insert [B2]
select 1,'01,05' union all
select 2,www.xu168.com'02' union all
select 3,'01,03' union all
select 4,'02,05' union all
select 5,'01,02,03' union all
select 6,'01,02,04,05' union all
select 7,'02,04'
go

with t
as(
select 
b.id,
a.内容 
from 
[B2] b
inner join 
[A1] a
on 
CHARINwww.1586f.comDEX(a.编码,b.内容)>0