擅长:python、mysql、java
<p>以下是我的作品,ORM风格:</p>
<pre><code>from sqlalchemy.sql import select, false
stmt = (
select([Beard, Moustache])
.select_from(
outerjoin(Beard, Moustache, false())
).apply_labels()
).union_all(
select([Beard, Moustache])
.select_from(
outerjoin(Moustache, Beard, false())
).apply_labels()
)
session.query(Beard, Moustache).select_entity_from(stmt)
</code></pre>
<p>它似乎是独立工作的,但似乎不可能与另一个选定的表达式结合起来</p>