OK, thank you.

I understand that there is no way to do this kind of thing with the ORM.
So I'm going to use litteral SQL in this case.

Le mercredi 13 janvier 2016 22:58:26 UTC+2, Michael Bayer a écrit :
>
> it would depend upon if this can be done within a single 
> cursor.execute() or if it would require multiple invocations. 
>
> At the very least, if the DBAPI that you're using can support it, I'd 
> start with direct cursor access as illustrated at 
>
> http://docs.sqlalchemy.org/en/rel_1_0/core/connections.html#working-with-raw-dbapi-connections.
>  
>
>  if the DBAPI can't support it then SQLAlchemy could not do it either. 
>
>
>
>
>
> On 01/13/2016 03:07 PM, yoch....@gmail.com <javascript:> wrote: 
> > Hello, 
> > 
> > I want to compute difference between successive records. 
> > In MySQL, I had written something like : 
> > 
> > | 
> > SET @prev:=0; 
> > SELECT time_to_sec(@prev),@prev:=ts FROM mytable; 
> > | 
> > 
> > How to achieve the same with sqlalchemy ? 
> > (I prefer to do it in SQL rather than python because I want to aggregate 
> > the results) 
> > 
> > Best regards 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "sqlalchemy" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> > an email to sqlalchemy+...@googlegroups.com <javascript:> 
> > <mailto:sqlalchemy+unsubscr...@googlegroups.com <javascript:>>. 
> > To post to this group, send email to sqlal...@googlegroups.com 
> <javascript:> 
> > <mailto:sqlal...@googlegroups.com <javascript:>>. 
> > Visit this group at https://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to