Disrupt07 ha scritto: > I have a users table and I want to query the usernames column. I want > my query to ignore the upper/lower casing. > > So the following searches should all match "John": "john", "jOhn", > "johN, "JOhn", and so on. > > My query at the moment is a follows: > names = queryselect(users.c.username.startswith("john")) > It depends on which db you're using. If you are using PostgreSQL for example you can use the ilike operator as:
users.c.username.op('ilike')('%'+'john'+'%') jo > How can I modify the query to obtain the above results? > > Thanks > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---