开发者社区 问答 正文

关于SQL使用内置函数decode、substr是否会用到索引?

关于SQL使用内置函数decode、substr是否可以用到索引?以下为业务SQL: select t.mobilephone, sysdate from user_visit_log_client t left join temp_dtnew_zhongduan t2 on t.mobilephone = t2.mdn where t.pmonth = substr(v_date,6,2) and t.pday = substr(v_date,9,2) and decode(t.fromer,'10010103', '3', '10010104', '4') = '3'

展开
收起
晓风瑟瑟 2021-10-13 13:35:55 1535 分享 版权
1 条回答
写回答
取消 提交回答
  • 可以使用索引,但需要在索引列上使用decode、substr这些函数,需要建立相应的函数索引。

    2021-10-16 12:15:43
    赞同 展开评论