Summary of Oracle wildcard Operators

Source: Internet
Author: User
Tags sqlplus

The where comparison conditions are as follows:

Equal to: =, <, <=,>, >=, <>

Including: In, not in exists, not exists

Range: between... and, not between... and

Matching Test: Like, not like null test: Is null, is not null

Boolean links: And, or, not

Wildcard: In the WHERE clause, the wildcard is used with the like condition.

In ORACLE: % (percent): represents any number of characters, or may have no characters at all.

_ (Underline): indicates the exact unknown character.

? (Question mark): used to indicate the exact unknown character.

# (Well number): used to indicate the exact Arabic number, ranging from 0 to 9.

[A-d] (square brackets): used to indicate the character range from A to D.

Qualified punctuation marks in the WHERE clause

Spaces in names: Avoid them as much as possible, and use underscores instead of spaces.

Separated by commas.

Single quotes: in Oracle, only single quotes should be used to enclose text, characters, and dates. numbers cannot be enclosed by single quotes (including single double quotes.

Double quotation marks: in Oracle, single double quotation marks have different meanings. Double quotation marks are used to enclose column aliases that contain specific characters or spaces. Double quotation marks are also used to place text in the date format.

Select first_name as "first name" from l_employees order by "first name"

# Font size: Use Access # font size to enclose numbers.

Semicolon: Used to end an SQL statement.

Reserved Words: Avoid using them.

Marker: in Oracle, the marker can also be written as two adjacent single quotes.

To search for all vendor names with marker in the Supplier name, you can write the code as follows: Select * From l_suppliers where supplier_name like '% ''%'

Blank rows: Oracle generally does not allow any blank rows in SQL statements. You can set an option in sqlplus to allow blank rows in SQL statements.

& Symbol: in Oracle, & symbol is often used to indicate a variable. For example, & Fox is a variable, a little different & fox. Every time & Fox appears in an oracle script, you are required to provide a value for it. To use & Fox, you only need to provide the variable value when & Fox appears for the first time. If you want to use & as a common symbol, you should disable this feature. To disable this feature, run the following command: set define off, which is a sqlplus command, not an SQL command. Sqlplus sets the environment in which SQL runs in Oracle.

Double vertical bars: Oracle uses double vertical bars to represent string connection functions.

Asterisk: Select * indicates that all columns are selected. Count (*) indicates that all rows are calculated. When a wildcard is used, it indicates 0 or any number of characters.

Forward slash: Used to terminate an SQL statement in Oracle. More accurately, it indicates "running SQL code in the buffer zone ". A forward slash is also used as a separator.

Multi-line comment :/*......*/. Not equal to: there are multiple expressions :! =, ^ =, <>, Not xxx = YYY, not (xxx = YYY)

Article reference from: http://blog.sina.com.cn/u/1234490375 copy> Add to favorites this page as links

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.