Skip site navigation (1) Skip section navigation (2)

Re: how to ignore case

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: lorid <lorid(at)dri(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: how to ignore case
Date: 2005-05-19 19:20:16
Message-ID: 1116530416.31821.103.camel@state.g2switchworks.com (view raw or flat)
Thread:
Lists: pgsql-admin
On Thu, 2005-05-19 at 13:52, lorid wrote:
> How can I do a simple select statement ignoring the case ? kinda like \i 
> in reg expressions ?
> 
> thanks in advance

You can use upper/lower:

select * from table where lower(somefield) like '%abc%';

or REGEX:

select * from table where lower ~* '.*abc.*';

SEe:

http://www.postgresql.org/docs/8.0/static/functions-matching.html#FUNCTIONS-POSIX-TABLE

In response to

Responses

pgsql-admin by date

Next:From: Scott MarloweDate: 2005-05-19 19:30:53
Subject: Re: how to ignore case
Previous:From: Jason MinionDate: 2005-05-19 19:06:08
Subject: Re: Can you generate SQL by using SQL in Postgres?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group