Re: [SQL] Case insensitive searchs

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: alewis(at)themecca(dot)net (Andy Lewis)
Cc: pgsql-sql(at)hub(dot)org
Subject: Re: [SQL] Case insensitive searchs
Date: 1999-04-19 16:25:29
Message-ID: m10ZGrR-0000bHC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Thus spake Andy Lewis
> I have a table that has city names in it. Some of the cities have a number
> of different cases. For instance I may have:
>
> San Antonio
> san antonio
> San antonio
> SAN ANTONIO
>
> My question is how can I do a distinct search for all cities and only get
> one of each city?

SELECT DISTINCT UPPER (city) FROM table;

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Giovanni Battista, Stefanoni 1999-04-19 20:17:05 6.4.2 and LEFT/RIGHT OUTER JOIN
Previous Message Michael J Davis 1999-04-19 15:18:37 RE: [SQL] OUTER JOINS