Support for IN and BETWEEN...AND queries in Tablestore

更新时间:
复制 MD 格式

Tablestore supports queries similar to the IN and BETWEEN...AND queries in relational databases. To run an IN query, you can use one of the following methods.

  • Method 1: After you create a table mapping, you can use the IN operator in the WHERE clause of a SELECT statement to run the query. This method is similar to an IN query in MySQL and offers better performance. For more information, see SQL operators.

  • Method 2: After you create a search index, you can use the terms query (TermsQuery) feature to run the query. This method supports terms queries on any column, is fully equivalent to an IN query in MySQL, and offers better performance.

  • Method 3: You can use the batch read data feature to run the query. This method supports only term queries on full primary keys.

To run a BETWEEN...AND query, you can use one of the following methods.