Обсуждение: how to ignore case

Поиск
Список
Период
Сортировка

how to ignore case

От
lorid
Дата:
How can I do a simple select statement ignoring the case ? kinda like \i
in reg expressions ?

thanks in advance

Lori

Re: how to ignore case

От
Scott Marlowe
Дата:
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

Re: how to ignore case

От
Scott Marlowe
Дата:
On Thu, 2005-05-19 at 14:20, Scott Marlowe wrote:

> or REGEX:
>
> select * from table where lower ~* '.*abc.*';

That second one should be:

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

either too much or not enough coffee

Re: how to ignore case

От
"Joel Fradkin"
Дата:
Ilike does case insensitive like I think its ~* for a case incenitive =
(might be *~)

Joel Fradkin

Wazagua, Inc.
2520 Trailmate Dr
Sarasota, Florida 34243
Tel.  941-753-7111 ext 305

jfradkin@wazagua.com
www.wazagua.com
Powered by Wazagua
Providing you with the latest Web-based technology & advanced tools.
C 2004. WAZAGUA, Inc. All rights reserved. WAZAGUA, Inc
 This email message is for the use of the intended recipient(s) and may
contain confidential and privileged information.  Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and delete and destroy
all copies of the original message, including attachments.




-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of lorid
Sent: Thursday, May 19, 2005 1:52 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] how to ignore case

How can I do a simple select statement ignoring the case ? kinda like \i
in reg expressions ?

thanks in advance

Lori

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings