Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
简单的问题。我有一个表人。我有两行:
1 Joe Doe joe.doe@ymail.com 2 Vivien Doe v.doe@gmail.com
如何编写 SOCI 语句,它将告诉我(返回)我的表中有多少行?(在这里,在我的示例中,我有 2 行)。
要获取 SQL 表中的行数,请使用如下count(*)函数:
count(*)
select count(*) from Person
更具体地说 - 将数字输入 C++ 变量使用:
int count; sql << "select count(*) from person", into(count);