使用LIKE运算符执行基于通配符的模糊查询,查询包含字符串的所有数据. 查询条件可以包含数字或者字符文本: %表示零个或者多个字符. _ 表示一个字符.

1.LIKE做模糊查询时,首字母确定使用索引

SQL> set autotrace trace exp
SQL> select last_name,salary
  2  from employees
  3  where last_name like 'K%';

在索引列上正确使用LIKE运算符

首字母不确定不走索引
SQL> select last_name,salary
  2  from employees
  3  where last_name like '_i%';

在索引列上正确使用LIKE运算符

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-21
  • 2022-12-23
  • 2021-08-17
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-06-23
  • 2022-12-23
  • 2021-05-30
相关资源
相似解决方案