--- title: "ZCQL V2 Syntax and Exceptions" url: https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/syntax-exceptions/ description: "ZCQL is Catalyst's own query language modelled after familiar query languages that you can use to query your app's database efficiently." last_updated: 2026-08-28T06:26:16Z service: Cloud Scale type: general --- # ZCQL V2 Syntax and Exceptions Catalyst has added several syntax upgrades and enhancements to help you write ZCQL queries more effectively. These new syntax upgrades will provide additional functionalities and enable you to perform data related operations in the Data Store with much ease. > **Note:** * To use these feature enhancements, you will need to migrate to the **V2** version. The syntax upgrades will not be applicable if you implement them while executing ZCQL commands in **V1**. * From **December 01st, 2024**, all your current projects in all your [Orgs](https://docs.catalyst.zoho.com/en/getting-started/catalyst-organizations/) present in the [Development Environment](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/development-environment/) will be automatically mapped to **ZCQL V2 Parser**. * From **April 01st, 2025**, all the projects present in all *Orgs* that have already been mapped to **ZCQL V2 Parser** in *Development Environment* will be automatically mapped to **ZCQL V2 Parser** in the [Production Environment](https://docs.catalyst.zoho.com/en/deployment-and-billing/environments/production-environment/), if and when production is enabled for the project. The following exception and syntax nuances need to be kept in mind when you execute a ZCQL query: 1. The [`AVG ()`](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/zcql-functions/#avg) ZCQL function can be applied on the following data types: - **Date** - **DateTime** - **Boolean** 2. When you are indicating a value in your ZCQL statement, indicate the value in single quotes. For example, if you have to fetch a particular name from an employee database, you will write the command in the following manner: ```sql SELECT Name FROM Employee_DB WHERE name = 'Amelia' ``` 3. If a column is of Boolean data type: - No string values are permitted. - Boolean data type will only support the following values: - FALSE - TRUE - NULL 4. If you are using an **Encrypted datatype**, then the following ZCQL functions cannot be used on that column: - `AVG()` - `SUM()` - `MAX()` - `MIN()` 5. [Appropriate exceptions](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/syntax-exceptions/#list-of-zcql-exceptions) have been added when you use comparative operators like `Less Than`, `Greater Than`, `Less Than or Equal`, and `Greater Than or Equal`, on **Encrypted Text**, and **Boolean** data type. These exceptions are not applicable for `Equal` and `Not Equal` operators. 6. Subqueries are now supported in `WHERE` clause statements. You can find out more about them from this [help document](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/where/#subqueries-in-where-clause). 7. [`ORDER BY`](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/groupby-orderby/#order-by-statement) clause now supports the use of [ZCQL functions](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/zcql-functions/). 8. In all columns where you use the `ORDER BY` clause, the `ASC` and `DESC` functionality can now be applied. You can also apply `ASC` and `DESC` for individual columns. **Example Database**: Consider the following database - **ZylkerEmployeeCompensation**
| Name | Salary | Reimbursement |
|---|---|---|
| Michelle Mascarenhas | 90000 | 10000 |
| Bruce Kyle | 3000000 | 45000 |
| Clark Kane | 3300 | 1500 |
| Judith Bridges | 4700 | 300 |
| Devon Dreymond | 80000 | 2300 |
| Ashley Kim | 6000 | 200 |
| ZylkerEmployeeCompensation.Salary | ZylkerEmployeeCompensation.Reimbursement |
|---|---|
| 3300 | 45000 |
| 4700 | 10000 |
| 6000 | 2300 |
| 80000 | 1500 |
| 90000 | 300 |
| 3000000 | 200 |
| Name | Salary | Reimbursement |
|---|---|---|
| Michelle Mascarenhas | 90000 | 10000 |
| Bruce Kyle | 3000000 | 45000 |
| Clark Kane | 3300 | 1500 |
| Judith Bridges | 4700 | 300 |
| Devon Dreymond | 80000 | 2300 |
| Ashley Kim | 6000 | 200 |
| Manager | Member |
|---|---|
| Michelle Mascarenhas | Bruce Kyle |
| Michelle Mascarenhas | Clark Kane |
| Judith Bridges | Michelle Mascarenhas |
| Manager.Name | Member.Name |
|---|---|
| Michelle Mascarenhas | Bruce Kyle |
| Michelle Mascarenhas | Clark Kane |
| Judith Bridges | Michelle Mascarenhas |
| Datatype | Case | Sample ZCQL Query | Triggered Exception |
|---|---|---|---|
| Encrypted Text | Certain operators are not supported | SELECT * FROM temp WHERE enc > 'temsp' | `Operator > is not supported for ENCRYPTED TEXT` The same exception applies, but the exception message will be altered accordingly if you use these operators **<**, **<=**, **>=** in the ZCQL statement |
| `LIKE` is not supported | SELECT * FROM temp WHERE enc LIKE '*temsp' | `Operator LIKE is not supported for ENCRYPTED TEXT` The same exception applies, but the exception message will be altered accordingly if you use **NOT LIKE** in the ZCQL statement | |
| `BETWEEN` is not supported | SELECT * FROM temp WHERE enc BETWEEN 'one' AND 'ten' | `Operator BETWEEN is not supported for ENCRYPTED TEXT` The same exception applies, but the exception message will be altered accordingly if you use **NOT BETWEEN** in the ZCQL statement | |
| `IN` is not supported | SELECT * FROM temp WHERE enc IN ('one','three') | `Operator IN is not supported for ENCRYPTED TEXT` The same exception applies if you use **NOT IN** in your query, but the exception message will be altered accordingly | |
| ZCQL functions is not supported | SELECT AVG(enc) FROM temp | `AVG() function is not supported for ENCRYPTED_TEXT` [ZCQL Functions](https://docs.catalyst.zoho.com/en/cloud-scale/help/zcql/zcql-functions/) are not supported in **Encrypted Text**. | |
| Boolean | Certain operators are not supported | SELECT * FROM temp WHERE bools > FALSE | `Operator > is not supported for BOOLEAN` The same exception applies, but the exception message will be altered accordingly if you use these operators **<**, **<=**, **>=** in the ZCQL statement |
| `LIKE` is not supported | SELECT * FROM temp WHERE bools LIKE FALSE | `Operator LIKE is not supported for BOOLEAN` The same exception applies if you use **NOT LIKE** in your query, but the exception message will be altered accordingly | |
| `BETWEEN` is not supported | SELECT * FROM temp WHERE bools BETWEEN TRUE and FALSE | `Operator BETWEEN is not supported for BOOLEAN` The same exception applies if you use **NOT BETWEEN** in your query, but the exception message will be altered accordingly | |
| `IN` is not supported | SELECT * FROM temp WHERE bools IN (TRUE, FALSE) | `Operator IN is not supported for BOOLEAN` The same exception applies if you use **NOT IN** in your query, but the exception message will be altered accordingly | |
| VarChar | Maximum length exceeded | INSERT INTO temp (Fishes) value ('salmon') | `'salmon' data too long for column 'Fishes'` The column `Fishes` was created as a **VarChar** and the **MaxLength** was set as `5`. In this statement, `'Salmon'` exceeds the **MaxLength** |
| Integer | Maximum value exceeded | INSERT INTO temp (numbers) VALUE (546895326908) | `For column 'ints' INT value should be between -9999999999 and 9999999999` The column numbers was created as **INT**. The value of **INT** datatype should be between `-9999999999` and `9999999999` |
| Big Integer | Maximum value exceeded | INSERT INTO temp (numbers) VALUE (92343432412351 435123453245) | `Given numeric value 92343432412351 435123453 is too large` The column numbers was created as **BIGINT**. The value of **BIGINT** datatype should be between `-9223372036854775808` and `9223372036854775807` |
| Text | Value not enclosed in single quotes | SELECT * FROM temp WHERE name = one | `Unknown Table temp or Unknown Column one in WHERE` The value `one` will be considered as column if it is not enclosed in quotes-'`one`' |