OceanBase logo

OceanBase

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

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

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

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 - V4.3.5

    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. V4.3.5
    iconOceanBase Database
    SQL - V 4.3.5
    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

    Expression list

    Last Updated:2026-04-09 02:53:55  Updated
    share
    What is on this page
    share

    An expression list is a group of expressions.

    You can use an expression list in a comparison or membership condition or a GROUP BY clause of a query or subquery. An expression list in a comparison or membership condition is sometimes called a row value constructor or row constructor.

    You can use a comparison or membership condition in a WHERE clause. They can contain one or more expressions separated by commas, or one or more groups of expressions, where each group contains one or more expressions separated by commas. To use multiple expression groups as a condition, observe the following requirements:

    • Each group is enclosed in brackets.

    • Each group must contain the same number of expressions.

    • The number of expressions in each group must match the number of expressions before the operator in the comparison condition, or match the number of expressions before the IN keyword in the membership condition.

    An expression list can contain a maximum of 1,000 expressions separated by commas. An expression group list can contain any number of expression groups separated by commas. However, each expression group can contain a maximum of 1,000 expressions separated by commas.

    The following shows examples of valid expression lists:

    (100, 200, 300)
    ('SCOTT', 'BLAIR', 'MARK')
    ( ('fruit', 'apple', 'red'),('vegetable', 'eggplant', 'purple') )
    

    In the third example, the number of expressions in each group must be the same as the number of expressions in the first part of the condition in the SQL statement. Here is an example:

    SELECT * FROM products
        WHERE (category, name, color) IN
            ( ('fruit', 'apple', 'red'),('vegetable', 'eggplant', 'purple') );
    

    An expression list in a simple GROUP BY clause can be in uppercase or lowercase, as shown in the following example:

    SELECT dept_id, MIN(salary) min, MAX(salary) max FROM emp
        GROUP BY dept_id, salary
        ORDER BY dept_id, min, max;
    
    SELECT dept_id, MIN(salary) min, MAX(salary) max FROM emp
        GROUP BY (dept_id, salary)
        ORDER BY dept_id, min, max;
    

    In ROLLUP and GROUPING SETS clauses of a GROUP BY clause, you can use both single expressions and expression groups in one expression list. The following shows examples of valid group expression lists in SQL statements:

    SELECT prod_category, prod_subcategory, country_id, cust_city, count(*)
        FROM products, sales, customers
        WHERE sales.prod_id = products.prod_id
            AND sales.cust_id=customers.cust_id
            AND sales.time_id = '01-dec-00'
            AND customers.cust_year_of_birth BETWEEN 1970 and 1980
        GROUP BY GROUPING SETS (
            (prod_category, prod_subcategory, country_id, cust_city), (prod_category, prod_subcategory, country_id),        (prod_category, prod_subcategory),
            country_id
            )
        ORDER BY prod_category, prod_subcategory, country_id, cust_city;
    

    Previous topic

    Type constructor expressions
    Last

    Next topic

    Overview
    Next