I do not understand. Can you make an example?
On Apr 11, 5:36 pm, AchipA <[email protected]> wrote:
> what would be the reverse of that ? if the field is the substring we
> want to locate ? I have a solution but it's ugly/hackish so I'm open
> to suggestions :)
>
> On Apr 10, 6:13 pm, mdipierro <[email protected]> wrote:
>
> > db(db.name.like('%alex%)).select()
>
> > On Apr 10, 4:04 pm, "web2py <<<at>>> technicalbloke.com"
>
> > <[email protected]> wrote:
> > > I can't seem to find a clear example of using 'like' in database
> > > selects.
>
> > > I'd like to do something like...
>
> > > SELECT * FROM `customers` WHERE customer.name LIKE "%alex%" LIMIT 10;
>
> > > ...but without resorting to executing the query directly via
> > > db.executesql(). The manual says...
>
> > > "You can build a query (using operators like ==, !=, <, >, <=, >=,
> > > like, belongs) and store the query in a variable q
>
> > > >>> q=name=='Alex'"
>
> > > ... so I know it's in there but I just don't see how 'like' and
> > > 'belongs' fit into that syntax: q=namelike'Alex' makes no sense
> > > surely. I'd be very grateful if someone could enlighten me as to the
> > > correct grammar.
>
> > > Cheers :)
>
> > > Roger.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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
-~----------~----~----~----~------~----~------~--~---