Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 1FA04475B50 for ; Wed, 12 Jun 2002 22:07:05 -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 36CFC476373 for ; Wed, 12 Jun 2002 22:06:59 -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 g5D28PQh022019; Wed, 12 Jun 2002 22:08:25 -0400 From: "isaac flemmin" To: "'Stephan Szabo'" Cc: Subject: Re: Case insensitive select Date: Wed, 12 Jun 2002 19:06:02 -0700 Message-ID: <000001c2127e$df411980$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: <20020612183244.D97399-100000@megazone23.bigpanda.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200206/162 X-Sequence-Number: 8127 Yes that worked. Thanks! I will have to look more at the lower function now so I know why that worked! Thanks again for the prompt response. Sincerely Isaac -----Original Message----- From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Stephan Szabo Sent: Wednesday, June 12, 2002 6:34 PM To: isaac flemmin Cc: pgsql-sql@postgresql.org Subject: Re: [SQL] Case insensitive select On Wed, 12 Jun 2002, isaac flemmin wrote: > Hello, > > I am using PostgreSQL 7.2 and I am trying to do a case insensitive > select statement using the lower function. I am using these lines from > the PostgreSQL 7.2 users guide as a template for my query. > > -- > "For example, a common way to do case-insensitive comparisons is to use > the lower function: > SELECT * FROM test1 WHERE lower(col1) = 'value';" > -- > > The query looks almost exactly the same but it always returns 0 results. > This does not make sense to me because if the query, > > "SELECT * FROM test1 WHERE col1 = 'Value';", > > returns something, then I assume the query, > > "SELECT * FROM test1 WHERE lower(col1) = 'value';", > > should return something as well. Do I not understand the way that the > lower function works, or is there something else I have to do? Obviously If col1 is char(n), the above may have wierd results due to padding spaces I believe. Does trim(lower(col1))='value' give results? ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org