Skip site navigation (1) Skip section navigation (2)

Re: Group by - Case insensitivity

From: Adam Ruth <aruth(at)intercation(dot)com>
To: UMPA Development <dev(at)umpa-us(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Group by - Case insensitivity
Date: 2004-06-28 16:37:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
Off the top of my head, I can think of a couple of ways.

select lower(name), count(*) from customer group by lower(name);


select min(name), count(*) from customer group by lower(name);

The second one works if you still want some semblance of the original 
casing of the field.

On Jun 28, 2004, at 9:15 AM, UMPA Development wrote:

> Hello all!
> Is it possible to setup a group by to be case insensitive and if so 
> how?
> Thank you!
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 8: explain analyze is your friend

In response to

pgsql-general by date

Next:From: Richard HuxtonDate: 2004-06-28 17:01:47
Subject: Re: Inconsistant DOW...
Previous:From: W.B.HillDate: 2004-06-28 16:23:25
Subject: Inconsistant DOW...

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group