I have a subquery table inner_stmt
, which I want to join with a table revisions
. But revisions.join()
gives the following error:
Neither 'Label' object nor 'Comparator' object has an attribute 'c'
Here is my code. What am I doing wrong?
inner_stmt = select([
ratings.c.article_name,
func.min(ratings.c.timestamp).label('mintime')]) \
.group_by(ratings.c.article_name).label('firstga')
stmt = select([
revisions.c.article_id,
func.max(revisions.c.length_bytes)]) \
.select_from(revisions.join(
inner_stmt,
revisions.c.article_name == inner_stmt.c.article_name)) \
.group_by(table.c.article_id)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.