Home  >  Article  >  Database  >  What is the usage of in in oracle

What is the usage of in in oracle

WBOY
WBOYOriginal
2022-01-21 11:00:2416876browse

In Oracle, in is often used in where conditional expressions. It can operate on data whose field values ​​meet the specified range. The syntax is "select * from table name where field in (value1, value2,… );".

What is the usage of in in oracle

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

What is the usage of in in Oracle

in is often used in conditional expressions (where). Its function is to operate, query or delete data within a certain range. The field value only needs to meet any one within this range

Query

select * from TableName(表名) where 字段 in (value1,value2,…);
select * from TableName(表名) where 字段 not in (value1,value2,…);
select 字段1,字段2,… from 表名 where 字段 in/not in (value1,value2,…);

Delete

delete from 表名 where 字段 in/not in (value1,value2,…);

Usage example:

in is used to query records

## Query all records in the t_hero table

# What is the usage of in in oracle##Query all records whose keyid is equal to one of the three values ​​​​(21, 16, 7), as long as these three values ​​are met One of the three can be queried.

What is the usage of in in oracleDelete the two records with keyid = (14,15)

What is the usage of in in oracleRecommended tutorial: "

Oracle tutorial

The above is the detailed content of What is the usage of in in oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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