All Products
Search
Document Center

ApsaraDB RDS:Operators

Last Updated:Aug 02, 2025

This topic describes the operators supported by Raster SQL, including their syntax, parameters, and examples.

Syntax

Raster SQL supports the =, >, <, >=, and <= operators. These operators compare the UUIDs of two raster objects in lexicographical order and are used in operations such as Union and B-tree.

bool Operator <operator>(raster rast1, raster rast2);

Return value

Returns true or false based on the result of the UUID comparison.

Note

Only the UUIDs of the two raster objects are compared. The spatial extent, pixel type, or other properties are not compared.

Parameters

Parameter

Description

rast1

The first raster object.

rast2

The second raster object.

Examples

Using the filter operators = and <= as examples, other filter operators are used in the same way as = and <=.

  • Example 1: Compare the UUIDs of raster objects in records that have the same ID.

    SELECT a.rast = b.rast
    FROM tbl_a a, tbl_b b
    WHERE a.id = b.id

    If the condition a.id=b.id is met, the statement returns true if the UUIDs of the corresponding records in the two tables are the same, and false otherwise.

  • Example 2: Compare the UUIDs of raster objects that have different IDs.

    SELECT a.rast <= b.rast
    FROM tbl_a a, tbl_b b
    WHERE a.id = 1 AND b.id = 2;

    If the condition a.id = 1 AND b.id = 2 is met, the statement returns true if the UUID of a.rast is lexicographically less than or equal to the UUID of b.rast, and false otherwise.