Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Python by mazvv ( 15 years ago )
case_expression = case([(Serp.periodical==1, text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 1 DAY)")),
                        (Serp.periodical==2, text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 2 DAY)"))],            
                        else_ = text("DATE_ADD(MAX(_positions.checkdt) , INTERVAL 7 DAY)")).label('next_check')
serps_list = Session.query(Serp, SerpGroups, case_expression).join(SerpGroups).outerjoin(Positions).group_by(Serp.rid)

 

Revise this Paste

Your Name: Code Language: