From eb4890972111528a30939cd19792c4a507258910 Mon Sep 17 00:00:00 2001 From: linrongbin16 Date: Sat, 8 Jan 2022 23:07:01 +0800 Subject: [PATCH] add example code for `count(1)` in Functions.md (#412) * add doc for `count(1)` --- docs/Functions.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/Functions.md b/docs/Functions.md index f23bea07..a74f4af7 100644 --- a/docs/Functions.md +++ b/docs/Functions.md @@ -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 :-)