Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/67.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 我需要找出不一致的值_Sql_Sql Server 2008 R2 - Fatal编程技术网

Sql 我需要找出不一致的值

Sql 我需要找出不一致的值,sql,sql-server-2008-r2,Sql,Sql Server 2008 R2,结果: select term, dial from #archiving where error_code = '308' 我需要排除有精确的十位数的术语,而不是我需要在术语中找出所有不一致的数字。最后应该是这样的 term dial 011211928433184 211928433184 2687176073 12687176073 2687177729 1268717

结果:

select term, dial from #archiving where error_code = '308' 
我需要排除有精确的十位数的术语,而不是我需要在术语中找出所有不一致的数字。最后应该是这样的

     term                  dial
  011211928433184        211928433184
    2687176073           12687176073
    2687177729           12687177729
0114317862324b7744      4317862324b7744211
  1.16141E+12             1.16141E+12
提前感谢您的帮助

这应该可以做到:

 term                     dial
011211928433184        211928433184
0114317862324b7744     4317862324b7744211
  1.16141E+12             1.16141E+12
SELECT term,
      dial
FROM   #archiving
WHERE  error_code = '308'
      AND LEN(CAST(term AS VARCHAR)) <> 10;