-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I already described by situation in issue #81.
but the Problem is now different.
How do i apply GROUP BY and ``ORDER BY``` to the union?
// curent working code missing ORDER BY
SQLPP_CREATE_NAME_TAG(timestamp);
(int id){
auto position=select(pos.ts.as(timestamp),pos.lon.as(sqlpp::alias::a),pos.lat.as(sqlpp::alias::b),sqlpp::value(std::optional<int>{}).as(sqlpp::alias::a)).where(pos.id==id);
auto sensor1= select(spec.ts.as(timestamp),sqlpp::value(std::optional<float>{}).as(sqlpp::alias::a),sqlpp::value(std::optional<float>{}).as(sqlpp::alias::b),spec.content.as(sqlpp::alias::c).where((spec.id==id)&&spec.type=="sensor1"))
db(position.union_distinct(sensor1));
}I would expect the following code to produce the wanted sql statement. But i get the error has no member order_by
position.union_distinct(sensor1).order_by(timestamp);Florian
Metadata
Metadata
Assignees
Labels
No labels