refactor: add clear_order_by for num_items (#2030)

This commit is contained in:
Shogo Nakano 2024-01-10 19:30:30 +09:00 committed by GitHub
parent c3344347f7
commit 3dc66aa17d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,12 @@ where
SelectStatement::new() SelectStatement::new()
.expr(Expr::cust("COUNT(*) AS num_items")) .expr(Expr::cust("COUNT(*) AS num_items"))
.from_subquery( .from_subquery(
self.query.clone().reset_limit().reset_offset().to_owned(), self.query
.clone()
.reset_limit()
.reset_offset()
.clear_order_by()
.to_owned(),
Alias::new("sub_query"), Alias::new("sub_query"),
), ),
); );