Right now, I'm writing this query as a string.  I want to know if it
can be expressed with SQLAlchemy's expressions instead.

Here's the query:

select sh.employee_id, sum(st.stop_time - st.start_time) as hours
from shift sh, shift_time st
where sh.employee_id in (28630, 28648)
and sh.shift_time_id = st.id
and st.start_time between timestamp '2008-11-02 00:00:00' and
timestamp '2008-11-09 00:00:00'
group by sh.employee_id
order by hours desc;

Any ideas?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to