mirror of
https://github.com/rbock/sqlpp11.git
synced 2026-01-06 21:20:42 -06:00
Added example for recursive CTE
This commit is contained in:
@@ -49,5 +49,11 @@ int With(int, char* [])
|
||||
|
||||
db(with(y)(select(y.alpha).from(y).unconditionally()));
|
||||
|
||||
using ::sqlpp::alias::a;
|
||||
using ::sqlpp::alias::b;
|
||||
const auto c =
|
||||
sqlpp::cte(b).as(select(t.alpha.as(a)).from(t).unconditionally().union_all(select(sqlpp::value(123).as(a))));
|
||||
db(with(c)(select(all_of(c)).from(c).unconditionally()));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user