OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V2.2.77Enterprise Edition

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & Certification
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V2.2.77
    iconOceanBase Database
    SQL - V 2.2.77Enterprise Edition
    SQL
    KV
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    Literals

    Last Updated:2023-08-18 09:26:34  Updated
    share
    What is on this page
    Text literals
    Numeric literals
    Datetime
    Escape characters

    folded

    share

    Text literals

    A text literal is a string that is enclosed by single quotation marks (') or double quotation marks ("). If you enable the ANSI_QUOTES mode, you can use only single quotation marks (') to enclose strings.

    Numeric literals

    Decimal numeric literals are divided into floating-point values and exact values that consist of integer and fixed-point values. Values can include a decimal point (.) as a decimal separator. Values that are prefixed with a minus sign (-) represent negative values.

    Hexadecimal numeric literals only support integer values that are prefixed with 0X, and allow letters from A to F. All letters are case-insensitive.

    Datetime

    Datetime literals can be in the text or numeric format.

    • In the text format, you can use full separators, for example, '2015-07-21 12:34:56.789'. You can also use no separators, for example, '20150721'.
    • The numeric format allows you to use only a decimal point (.) to separate the seconds and microseconds, for example, 20150721123456.789.

    • A decimal point (.) must be used between seconds and microseconds. If you require other separators, we recommend that you use only common separators such as hyphens (-), forward slashes (/), and colons (:).

    Escape characters

    An escape character is a backslash (\) that invokes an alternative interpretation on the following characters in a character sequence. Escape characters are case-sensitive. For example, \b represents the backspace and \B represents the B character.

    The following table lists all escape characters.

    Escape character Description
    \b A backspace.
    \f A form feed.
    \n A line feed.
    \r A carriage return.
    \t A tab character.
    \\ A backslash (\).
    \' A single quotation mark (').
    \" A double quotation mark (").
    \_ An underscore (_).
    \% A percent sign (%).
    \0 NULL
    \Z ASCII 26 (Ctrl+Z).

    Previous topic

    Data comparison rules
    Last

    Next topic

    Comments
    Next
    What is on this page
    Text literals
    Numeric literals
    Datetime
    Escape characters