日期:2014-05-18 浏览次数:20896 次
select a from A where a not in (select a from B )
order by
case when len(a) < 3 then 0
when charindex('-',a) < 3 then 0
when patindex('%^[0-9]%',substing(a,2,charindex('-',a)-2))>0 then 0
else substing(a,2,charindex('-',a)-2) end
------解决方案--------------------
select a from A where a not in (select a from B )
order by
case when len(a) < 3 then 0
when charindex('-',a) < 3 then 0
when patindex('%^[0-9]%',substing(a,2,charindex('-',a)-2))>0 then 0
else cacst(substing(a,2,charindex('-',a)-2) as int) end