Re: lower() not working correctly...?

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: lower() not working correctly...?
Date: 2006-09-15 08:44:25
Message-ID: 20060915084425.GC21235@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

am Fri, dem 15.09.2006, um 10:06:40 +0200 mailte Andreas Joseph Krogh folgendes:
> I have the following query:
>
> select lower(firstname) || ' ' || lower(lastname) from person
>
> firstname and lastname are VARCHAR
>
> lower() returns NULL when firstname OR lastname is NULL, is this correct?

Yes. You can user coalesce for this:

select coalesce(lower(firstname),'') || ...

HTH, Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Amit_Wadhwa 2006-09-15 08:50:13 Re: lower() not working correctly...?
Previous Message Guillaume Lelarge 2006-09-15 08:44:22 Re: lower() not working correctly...?