Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/76.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.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
SQL Server 2012:关键字';订单';_Sql_Sql Server 2012 - Fatal编程技术网

SQL Server 2012:关键字';订单';

SQL Server 2012:关键字';订单';,sql,sql-server-2012,Sql,Sql Server 2012,我在运行此查询时遇到此错误 select *, stuff(PartNumber,1,3,'') from products.products where isnumeric(stuff(partNumber,1,3,'') order by cast(Stuff(partNumber,1,3,'')As Float) 有什么想法吗 谢谢 其中的语句不完整: where isnumeric(stuff(partNumber,1,3,'')) = 1 -----------------

我在运行此查询时遇到此错误

select *, stuff(PartNumber,1,3,'') 
from products.products 
where  isnumeric(stuff(partNumber,1,3,'') 
order by cast(Stuff(partNumber,1,3,'')As Float)
有什么想法吗


谢谢

其中的
语句不完整:

where  isnumeric(stuff(partNumber,1,3,'')) = 1
-----------------------------------------^

看起来您缺少了一个括号:

这:

应该是:

where  isnumeric(stuff(partNumber,1,3,'')) 

首先是缺少闭括号“)”,另一个是当输入表达式的计算结果为有效的数字数据类型时,必须在where子句中指定isnumeric返回1

   `    select *, stuff(PartNumber,1,3,'') 
        from products.products 
      where  isnumeric(stuff(partNumber,1,3,'')) =1
     order by cast(Stuff(partNumber,1,3,'') As Float)
  `
   `    select *, stuff(PartNumber,1,3,'') 
        from products.products 
      where  isnumeric(stuff(partNumber,1,3,'')) =1
     order by cast(Stuff(partNumber,1,3,'') As Float)
  `