there's no simple way to do it. I'd suggest you fetch the first record, then every other record (ordered as you like) and then merge the resultsets.
On Saturday, June 14, 2014 8:39:32 AM UTC+2, Kenneth wrote: > > Hi, > > I have a table that contains 5 items. Usually I order them by product > name. Now I'd like to order them so a specific ID is first and then the > rest. As everything else is ready I'm looking into making the SQL query do > the ordering. > > I found a posting ( > https://groups.google.com/forum/?fromgroups#!searchin/web2py/orderby$20$20case/web2py/B9iM-r1rV0A/jPMBmoSv2kgJ > > ) where CASE was used with orderby but I just couldn't understand how to > get it working. > > Is this the way or is there an other way to do this? > > > Kenneth > > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.