SqlAlchemy: case statement (case - if - then -else)

后端 未结 2 1428
傲寒
傲寒 2021-02-12 19:57

I\'m wondering if there\'s a way to create a case statement with SqlAlchemy, e.g. the postgresql version

Maybe literal SQL is the way to go if there is no

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-12 20:39

    Check out the documentation about the case statement here: http://docs.sqlalchemy.org/en/latest/core/sqlelement.html#sqlalchemy.sql.expression.case

提交回复
热议问题