Skip to content

Commit

Permalink
[fix] Remove count function
Browse files Browse the repository at this point in the history
  • Loading branch information
chenzhuoyu committed Aug 10, 2024
1 parent d9e1942 commit 2a41a3c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/content/primary-key-table/merge-engine/aggregation.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ Current supported aggregate functions and data types are:
It supports DECIMAL, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, and DOUBLE data types.

### count
In scenarios where counting rows that match a specific condition is required, you can use the SUM function to achieve this. By expressing a condition as a Boolean value (TRUE or FALSE) and converting it into a numerical value, you can effectively count the rows. In this approach, TRUE is converted to 1, and FALSE is converted to 0.
In scenarios where counting rows that match a specific condition is required, you can use the SUM function to achieve this. By expressing a condition as a Boolean value (TRUE or FALSE) and converting it into a numerical value, you can effectively count the rows. In this approach, TRUE is converted to 1, and FALSE is converted to 0.

For example, if you have a table orders and want to count the number of rows that meet a specific condition, you can use the following query:
```sql
SELECT SUM(CASE WHEN condition THEN 1 ELSE 0 END) AS count
FROM orders;
```
For example, if you have a table orders and want to count the number of rows that meet a specific condition, you can use the following query:
```sql
SELECT SUM(CASE WHEN condition THEN 1 ELSE 0 END) AS count
FROM orders;
```


### max
Expand Down

0 comments on commit 2a41a3c

Please sign in to comment.