Re: [SQL] Case insensitive searchs

From: reedstrm(at)wallace(dot)ece(dot)rice(dot)edu (Ross J(dot) Reedstrom)
To: alewis(at)themecca(dot)net (Andy Lewis)
Cc: pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] Case insensitive searchs
Date: 1999-04-18 18:51:15
Message-ID: m10Ywex-000LJrC@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hmm, what version of postgresql are you using? In my hands, the 'distinct'
works on the output of ther function call, as seen in my previous email.
You do realize that 'distinct' works on the entire returned row, not
just a single field, so, to continue my previous example:

test=> select distinct initcap(city),upper(state) from addr_table;
initcap |upper
-----------+-----
San Antonio|TX
(1 row)

test=> select distinct initcap(city),upper(state),oid from addr_table;
initcap |upper| oid
-----------+-----+-----
San Antonio|TX |25354
San Antonio|TX |25355
San Antonio|TX |25356
San Antonio|TX |25357
(4 rows)

test=> select distinct initcap(city),upper(state),oid from addr_table group by initcap(city);
initcap |upper| oid
-----------+-----+-----
San Antonio|TX |25354
(1 row)

test=>

> The problem is that I don't know all of the city names.
>
> I was trying to do a:
>
> select distinct lower(city) from mytable

is that _all_ the return fields you specified?

Ross
--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andy Lewis 1999-04-18 18:58:30 Re: [SQL] Case insensitive searchs
Previous Message Ross J. Reedstrom 1999-04-18 18:44:39 Re: [SQL] Case insensitive searchs