赞
踩
基本语法:db.session.query(Models1).filter()
详细参考资料:flask的ORM操作
test= db.session.query("name from student where sys_param_key='ccb_test_scope'").all()[0][0]
## 使用原生sql语句进行查询
from sqlalchemy.sql import text
res = db_session.query(Student).from_statement(text("SELECT * FROM STUDENT WHERE STUDENT_ID=:STUDENT_ID")).\
params(STUDENT_ID="179074001").first()
print(res.student_id,res.name,sep=": ")
db.session.excute(sql语句)
change_info = db.session.query(Classo.id, Class.desc, Class.name, Class.online_plan
).filter(Class.id == 10).one()
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。