Hello everyone, I've got this query:
selectexpr = session.query(Host, Architecture, OS_Kind, OS_version, Virtualization, Project, Reservation) ... selectexpr = selectexpr.filter(or_(Host.earliest_reservation_id == None, and_(Host.earliest_reservation_id == Reservation.id, Reservation.start_date < sd))) The problem with this query is that SQLA/Postgres does a join on Host.earliest_reservation_id == None (producing each combination of every Reservation and every host with Host.earliest_reservation_id = NULL). Now I could make a second query like session.query(Host, Architecture, OS_Kind, OS_version, Virtualization, Project), but do I have to? Is there some way to account for condition Host.earliest_reservation_id == None and produce None / NULL as Reservation in resulting row tuple as result of a single query? Regards, mk --~--~---------~--~----~------------~-------~--~----~ 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 sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---