Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 16E15475EF7 for ; Sat, 11 Jan 2003 19:28:17 -0500 (EST) Received: from ebox2.sentricity.com (ebox2.sentricity.com [64.7.141.8]) by postgresql.org (Postfix) with ESMTP id 49A0C475CA9 for ; Sat, 11 Jan 2003 19:28:16 -0500 (EST) Received: from [192.168.123.27] (dcdsl.ebox.com [64.7.143.116]) (authenticated) by ebox2.sentricity.com (8.11.0/8.11.0av) with ESMTP id h0C0SH731401; Sat, 11 Jan 2003 19:28:18 -0500 Subject: Re: Select * from users WHERE upper(lastName) = From: Dave Cramer To: Hale@halepringle.com Cc: "pgsql-jdbc@postgresql.org" In-Reply-To: References: Content-Type: text/plain Organization: Message-Id: <1042331290.2327.6.camel@inspiron.cramers> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.1.90 (Preview Release) Date: 11 Jan 2003 19:28:11 -0500 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/129 X-Sequence-Number: 5979 What does select * from ... where trim(upper(lastname)) == upper('Pringle') return? Dave On Fri, 2003-01-10 at 18:45, Hale Pringle wrote: > I have notices that when you want to use the upper() function, you must also > use the trim(). > > For example, > In a situation where a column names lastname is char(40): > SELECT * FROM users WHERE lastname = 'Pringle' returns one row. > > SELECT * FROM users WHERE UPPER(lastname) = UPPER('Pringle') will return > zero rows. > > SELECT * FROM users WHERE TRIM(UPPER(lastname) = TRIM(UPPER('Pringle')) > will return one row. > > This seems odd to me. Can someone explain? > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Dave Cramer