Re: Select * from users WHERE upper(lastName) =

From: Dave Cramer <Dave(at)micro-automation(dot)net>
To: Hale(at)halepringle(dot)com
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Select * from users WHERE upper(lastName) =
Date: 2003-01-12 00:28:11
Message-ID: 1042331290.2327.6.camel@inspiron.cramers
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

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(at)postgresql(dot)org)
--
Dave Cramer <Dave(at)micro-automation(dot)net>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-01-12 00:50:59 Re: persistent JDBC connections with a daemon
Previous Message Dave Cramer 2003-01-12 00:24:43 Re: Sequence

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2003-01-12 04:45:58 Re: Select * from users WHERE upper(lastName) = upper('Pringle')
Previous Message postgres 2003-01-12 00:03:03 Re: switching default integer datatype to int8 and "IN (...)"