Re: [sqlalchemy] query vs select

2012-04-13 Thread Michael Bayer
there's nothing particularly advanced in that query and either system can accomplish it in a straightforward way. What's the part of it that isn't clear ? Here you'd be using funx.max(), join(), x != None, group_by() and order_by(). On Apr 13, 2012, at 1:59 AM, jo wrote: Thanks Michael,

Re: [sqlalchemy] query vs select

2012-04-13 Thread jo
Michael Bayer wrote: there's nothing particularly advanced in that query and either system can accomplish it in a straightforward way. What's the part of it that isn't clear ? Here you'd be using funx.max(), join(), x != None, group_by() and order_by(). II did it in this way:

[sqlalchemy] query vs select

2012-04-12 Thread jo
Hi all, I'm sorry for this simple question. What's the difference between query and select ? are they interchangeable? which of the two, it is best to use? --- print(session.query(Azienda.c.data_inizio).limit(1)) SELECT azienda_data_inizio FROM (SELECT azienda.data_inizio AS

Re: [sqlalchemy] query vs select

2012-04-12 Thread Michael Bayer
There's some degree of history here as SQLAlchemy initially didn't have the whole generative notion of things, and the Mapper object itself would accept arguments which it passed mostly straight to a select() object. So you saw similar interfaces and it was kind of like switching between

Re: [sqlalchemy] query vs select

2012-04-12 Thread jo
Thanks Michael, your explanation is comprehensive, currently I'm using both of them, but I feared that one of them could become obsolete in the future. I'm trying to translate some queries that I had done with engine but I find it hard to do. For example, a query like this one, I can not set it