Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D11324763A0 for ; Wed, 12 Jun 2002 21:28:04 -0400 (EDT) Received: from plato.knox.net (host129-205.mt-vernon.lib.oh.us [131.187.129.205]) by postgresql.org (Postfix) with ESMTP id 959B8475D7B for ; Wed, 12 Jun 2002 21:27:58 -0400 (EDT) Received: from ixic (evrtwa1-ar13-4-62-070-173.evrtwa1.dsl-verizon.net [4.62.70.173]) by plato.knox.net (8.12.1/8.12.1) with ESMTP id g5D1TWQh020644; Wed, 12 Jun 2002 21:29:33 -0400 From: "isaac flemmin" To: , Subject: Re: Case insensitive select Date: Wed, 12 Jun 2002 18:27:02 -0700 Message-ID: <000001c21279$6c2fcd10$ad463e04@ixic> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3311 Importance: Normal In-Reply-To: <200206121808.19116.josh@agliodbs.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200206/159 X-Sequence-Number: 8124 Thanks for the prompt reply, but while I was waiting for a reply I discovered that using the RE operator '~*' will give me results, but if in col1 there is are both 'value', and 'value1' and I look for value by doing SELECT * FROM test1 WHERE col1 ~* '^value'; I get both of them, value, and value1. (I freely admit I do not know much about regular expressions so I will continue to read about them and see if I can get something to work for me, but while I am working on that any more advice would be helpful!) Also I did try ILIKE before I wrote the email and it did not work for me unless I would put a % at the end of the string, eg. SELECT * FROM test1 WHERE col1 ILIKE 'value'; would not return any results, but SELECT * FROM test1 WHERE col1 ILIKE 'value%'; would return both the rows with value and value1. Neither of these are acceptable, because I only want to find exact matches that are case insensitive. I have been reading the documentation on operators and functions but as of yet, have not discovered anything that will work correctly 100% of the time. So once again I would appreciate any ideas on why this may not be working for me. Thanks again for the reply. Isaac -- -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Josh Berkus Sent: Wednesday, June 12, 2002 6:08 PM To: isaac flemmin; pgsql-sql@postgresql.org Subject: Re: [SQL] Case insensitive select Issac, > I am doing something wrong or it would be working. I really have no idea > how to do a case insensitive query other than with the lower function. > If there is anyone out there who has any ideas on how to help me or can > point me toward something that will help me it would be very > appreciated. There is also: SELECT * FROM test1 WHERE col1 ~* '^value'; or: SELECT * FROM test1 WHERE col1 ILIKE 'value'; See Operators and Functions in the online docs. -- -Josh Berkus ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly