mirror of
https://github.com/rbock/sqlpp11.git
synced 2024-11-16 04:47:18 +08:00
Added test which selects count()
This commit is contained in:
parent
6dbdd39ce1
commit
49eb21e709
@ -69,6 +69,11 @@ int main()
|
|||||||
std::cout << row.alpha << std::endl;
|
std::cout << row.alpha << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const auto& row : db(select(count(t.alpha), avg(t.alpha)).from(t).where(true)))
|
||||||
|
{
|
||||||
|
std::cout << row.count << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
auto stat = sqlpp::select().columns(all_of(t)).flags(sqlpp::all).from(t).extra_tables(f,t).where(t.alpha > 0).group_by(t.alpha).order_by(t.gamma.asc()).having(t.gamma).limit(7).offset(19);
|
auto stat = sqlpp::select().columns(all_of(t)).flags(sqlpp::all).from(t).extra_tables(f,t).where(t.alpha > 0).group_by(t.alpha).order_by(t.gamma.asc()).having(t.gamma).limit(7).offset(19);
|
||||||
|
|
||||||
auto s = dynamic_select(db).dynamic_columns(all_of(t)).dynamic_flags().dynamic_from(t).extra_tables(f,t).dynamic_where().dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset();
|
auto s = dynamic_select(db).dynamic_columns(all_of(t)).dynamic_flags().dynamic_from(t).extra_tables(f,t).dynamic_where().dynamic_group_by(t.alpha).dynamic_order_by().dynamic_having(t.gamma).dynamic_limit().dynamic_offset();
|
||||||
|
Loading…
Reference in New Issue
Block a user