其他不知道,select XXX from table1, table2, table3这样写,你们的技术主管看到你就死定了
先改成join,咱们再聊怎么用sqlalchemy查询。
2014-09-18 8:23 GMT-07:00 tinytub <
zhaope...@gmail.com>:
>
> 写了一个 sql,同时查询多个表的内容...然后, 不知道该怎么翻译成 flash-sqlalchemy了
> select a.map, b.map,
b.name , c.map,
c.name from test_table1 as a,
> test_table2 as b, test_table3 as c where a.test1_id=
b.id and
> a.test2_id=
c.id;
>
> 查了半天 模仿sqlalchemy 用db.session.query(test_table1, test_table2,
> test_table3).with_entities(****).with_entities(***) 这样的查询形式在
> flask-sqlalchemy 里试了一下,出的结果只有最后一个 with_entities 所涉及的字段.
>
> 我知道肯定是我使用的方法不对.
>
> 希望各位能给我一个思路,多谢~
>
> --
> --
> 邮件来自: `CPyUG`华蟒用户组(中文Python技术邮件列表)
> 规则:
http://code.google.com/p/cpyug/wiki/PythonCn
> 发言:
pyth...@googlegroups.com
> 详情:
http://code.google.com/p/cpyug/wiki/CpyUg
> G+:
https://plus.google.com/u/0/communities/108786798869709602787
> 严正: 理解列表! 智慧提问!
http://wiki.woodpecker.org.cn/moin/AskForHelp
> ---
> 您收到此邮件是因为您订阅了Google网上论坛中的“python-cn(华蟒用户组,CPyUG 邮件列表)”论坛。
> 要退订此论坛并停止接收此论坛的电子邮件,请发送电子邮件到
python-cn+...@googlegroups.com。
> 要在网络上查看此讨论,请访问
https://groups.google.com/d/msgid/python-cn/a1da6d26-c55f-4cd1-a741-f151d3506d23%40googlegroups.com。
> 要查看更多选项,请访问
https://groups.google.com/d/optout。
--
yegle
http://about.me/yegle