📅  最后修改于: 2022-03-11 15:05:33.390000             🧑  作者: Mango
updated_rows = (
session.query(YourTable)
.filter(YourTable.your_field.like('%est%'))
.update({YourTable.your_field: func.replace(YourTable.your_field, 'from_str', 'to_str')},
synchronize_session=False)
)
print("Updated {} rows".format(updated_rows))