Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
最大函数为';t在SQLServer2005中工作_Sql_Sql Server 2005 - Fatal编程技术网

最大函数为';t在SQLServer2005中工作

最大函数为';t在SQLServer2005中工作,sql,sql-server-2005,Sql,Sql Server 2005,我只想从Visitor表中找到最大值。最后一个工作正常,但当数字在VI9999之后出现时,它总是返回相同的最大值,而不是VI10000。请告诉我我将为此做些什么 提前谢谢 Sql查询: select MAX(TSID) FROM VISITOR_TABLE; select Max(cast(substring(TSID, 3, 10) as int)) FROM VISITOR_TABLE;

我只想从
Visitor
表中找到最大值。最后一个工作正常,但当数字在VI9999之后出现时,它总是返回相同的最大值,而不是VI10000。请告诉我我将为此做些什么

提前谢谢

Sql查询:

select MAX(TSID) 
FROM VISITOR_TABLE;
select Max(cast(substring(TSID, 3, 10) as int)) 
FROM VISITOR_TABLE;