I would to execute a sql request (a SELECT one) by a mysql database. The rows coming from this request would then be used to populate rows in another table. All by using the sqlalchemy ORM. I believe it could look like a sql merge into statement, which would take care of the updates of rows previously added in the second table.
Typically my sqlalchemy query looks like this:
print sess.query(User.platform, User.population_current,
func.count(distinct(User._id))).filter(func.date(User.updated_at) == date.today()).all()
And I would like to use the results of this request to populate another table.