34,594
社区成员
发帖
与我相关
我的任务
分享
DECLARE @t TABLE (v VARCHAR(100))
INSERT INTO @t
SELECT '100' UNION
SELECT '2' UNION
SELECT 'A200'
SELECT MAX(convert(BIGINT,t.v)) FROM @t AS t WHERE ISNUMERIC(t.v)=1
create table tb
(Sid int,SSno varchar(10))
go
insert into tb
select 1,'2015092401' union all
select 2,'2015092403' union all
select 3,'2015092405' union all
select 4,'2015092407' union all
select 5,'2015092409' union all
select 6,'793232' union all
select 7,'12324222' union all
select 8,'A02782' union all
select 9,'n2930'
select MAX(convert(int,ssno)) from tb where isnumeric(ssno)=1
select max([列名])
from [表名]
where isnumeric([列名])=1