0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

add example code for count(1) in Functions.md (#412)

* add doc for `count(1)`
This commit is contained in:
linrongbin16 2022-01-08 23:07:01 +08:00 committed by Roland Bock
parent 9b8463b1f6
commit eb48909721

View File

@ -35,6 +35,11 @@ for (const auto& row : db(select(tab.name, avg(tab.value))
}
```
Use `count(1)` for simply query row count:
```C++
const int64_t n = db(select(count(1)).from(tab).unconditionally()).front().count;
```
# Text Functions
## concat
Just use the + operator :-)