0
我想执行使用SQLAlchemy的(与模型评价)这个SQL查询:Sqlalchemy:如何执行外部连接?
select e1.user, sum(e1.points) as s from
(select e1.*
from evaluations e1 left outer join evaluations e2
on (e1.user = e2.user and e1.module = e2.module and e1.time < e2.time)
where e2.user is null and e1.module in (__another subquery__))
group by e1.user order by s limit 5
我不知道如何执行左外连接(特别是具有重命名和更名comlumns的引用)。你可以帮帮我吗?
请参阅本文档的[Using Aliases](http://docs.sqlalchemy.org/en/rel_1_0/orm/tutorial.html#using-aliases)部分。 'label'允许命名列。 – van