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
from A
where a not in (select a from B )
order by cast (substring(a,2,len(a)-3) as int )
order by cast(substring(a,2,charindex('-',a)-1 -1) as int)
from A t
where not exists(select 1 from B where t.a = a )
order by cast (substring(a,2,len(a)-3) as int )
order by cast(substring(a,2,len(a)-3) as int)
求教高手啊……
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
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