Home > Database > Oracle > body text

What is the usage of not like in oracle

WBOY
Release: 2022-03-03 10:26:44
Original
13558 people have browsed it

In Oracle, the "not like" operator is used to search for specified content that does not include columns in the WHERE clause, which can achieve the effect of fuzzy query. The syntax is "SELECT field FROM table name WHERE field NOT LIKE wildcard".

What is the usage of not like in oracle

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

What is the usage of not like in oracle

LIKE operator

The LIKE operator is used to search for the specified pattern in the column in the WHERE clause.

SQL LIKE operator syntax

SELECT column_name(s)
FROM table_name
WHERE column_name LIKE pattern
Copy after login

By using the NOT keyword, you can search for content that does not contain the specified content in the column

There are two wildcards: % percent sign represents any number Character, _underscore represents a character.

1. like'Mc%' will search for all strings starting with the letters Mc.

2. like'%inger' will search for all strings ending with the letters inger.

3. like'%en%' will search for all strings containing the letter en at any position.

The example is as follows:

Original table

What is the usage of not like in oracle

By using the NOT keyword, we can select from the "Persons" table People who live in cities that do not contain "lon":

We can use the following SELECT statement:

SELECT * FROM Persons
WHERE City NOT LIKE '%lon%'
Copy after login

The results are as follows:

What is the usage of not like in oracle

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of What is the usage of not like in oracle. 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