Thanks for the note Massimo, I did test what you suggested, but it's not working with no error or ticket generated ... I print the generated SQL query and it looks fine... I think DAL doesn't handle "Case"... Thanks anyway I'll used a work around solution...
Cheers, Yannick P. On Nov 26, 8:27 am, mdipierro <[email protected]> wrote: > You cannot but you can try this: > > db(db.employees.salary, > "CASE WHEN salary <= 2000 THEN 'PoorOne' END AS salary_level", > orderby=db.employees.salary) > > let us know if it works. > > On Nov 26, 6:53 am, Yannick <[email protected]> wrote: > > > Hello Mate, > > > I just double check in the book and the documentation resources > > because I was wondering how to actually create a DAL query that > > include "Case" statement ? > > Like let's say I have an SQL like this : > > > SELECT salary, > > CASE > > WHEN salary <= 2000 THEN 'PoorOne' > > END AS salary_level > > FROM employees > > ORDER BY salary ASC > > > How can I write such a query with "CASE" statement in Web2py ? > > > Thanks, > > Yannick P. -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.

