zoukankan      html  css  js  c++  java
  • charindex使用一个异常记录思考

    select substring(a,1, charindex(a,'b')-1) from t where name like '%aa%'

    我检查到数据库的符合条件只有两条,两条的字段a都是有值的,

    但数据库一直报一个异常,意思差不多就是a字段为空导致substring的第三个参数出错。

    后面查看执行计划,原来该语句为全表扫描,所有记录都会先运算再筛选。

    这个异常较为典型,特此记录一下。

    任何对列的操作都将导致表扫描
  • 相关阅读:
    GPO
    GPO
    GPO
    Active Directory
    Active Directory
    Ethical Hacking
    Tree and Queries CodeForces
    数颜色 HYSBZ
    Powerful array CodeForces
    Group HDU
  • 原文地址:https://www.cnblogs.com/wangxiaohuo/p/2501359.html
Copyright © 2011-2022 走看看