mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
In subquery use alias to do 'order by' (#795)
* in subqry add orderby metric to select * add comment
This commit is contained in:
parent
9cdd289081
commit
19f5371787
@ -728,6 +728,9 @@ class SqlaTable(Model, Queryable, AuditMixinNullable):
|
||||
qry = qry.limit(row_limit)
|
||||
|
||||
if timeseries_limit and groupby:
|
||||
# some sql dialects require for order by expressions
|
||||
# to also be in the select clause
|
||||
inner_select_exprs += [main_metric_expr]
|
||||
subq = select(inner_select_exprs)
|
||||
subq = subq.select_from(tbl)
|
||||
subq = subq.where(and_(*(where_clause_and + inner_time_filter)))
|
||||
|
Loading…
Reference in New Issue
Block a user