In general, the following two methods are used to perform a fuzzy query on the name field of the tb table in the Oracle database: 1. select * fromtbwherenamelike
In general, the following two methods are used to perform a fuzzy query on the name field of the tb table in the Oracle database: 1. select * from tb where name like
In general, the following two methods are used to perform a fuzzy query on the name field of the tb table in the Oracle database:
1. select * from tb where name like '% XX % ';
2. select * from tb where instr (name, 'xx')> 0;
If no index is added to the name field, the efficiency is similar and there is basically no difference between the two.
To improve efficiency, we can add a non-unique index to the name field:
Create index idx_tb_name on tb (name );
In this way, use
Select * from tb where instr (name, 'xx')> 0;
The efficiency of such statement query can be improved a lot. The larger the table data volume, the larger the difference between the two. However, you must also consider the impact of the DML Statement on the re-sorting of index data after the name field is indexed.