Home > Database > Oracle > body text

How does Oracle determine whether it contains characters?

WBOY
Release: 2022-05-24 18:29:33
Original
15768 people have browsed it

Method: 1. Use like with "%", the syntax is "where field like '% character %';"; 2. Use the contains function, the syntax is "contains (field, 'character');" ;3. Use the instr function, the syntax is "instr (field, 'character') > 0".

How does Oracle determine whether it contains characters?

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How does oracle determine whether it contains characters

1. Use the wildcard character "%"

The syntax is similar:

select * from students where 字段 like ‘%字符%’
Copy after login

The example is as follows:

How does Oracle determine whether it contains characters?

2. Use the contains function

The syntax is:

select * from table1 where contains(字段, ‘字符’);
Copy after login

The example is as follows:

How does Oracle determine whether it contains characters?

There is a condition for using the contains predicate, that is, the column must be indexed. That is to say, if the Column1 column of the table1 table in the above statement is not indexed, an error will be reported, which has relatively large limitations.

3. Use the instr function

The syntax is:

select * from table1 where instr(字段,'字符') > 0 ;
Copy after login

The example is as follows:

How does Oracle determine whether it contains characters?

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How does Oracle determine whether it contains characters?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!