Group by - Case insensitivity

Started by DEValmost 22 years ago4 messagesgeneral
Jump to latest
#1DEV
dev@umpa-us.com

Hello all!

Is it possible to setup a group by to be case insensitive and if so how?

Thank you!

#2Adam Ruth
aruth@intercation.com
In reply to: DEV (#1)
Re: Group by - Case insensitivity

Off the top of my head, I can think of a couple of ways.

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

or

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:

Show quoted text

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

#3Chris Browne
cbbrowne@acm.org
In reply to: DEV (#1)
Re: Group by - Case insensitivity

In the last exciting episode, dev@umpa-us.com (UMPA Development) wrote:

Is it possible to setup a group by to be case insensitive and if so how?

Well, you could presumably canonicalize the field to one case or the
other, thereby forcing the issue. That's not _exactly_ the same thing
as "case insensitivity," but it may be close enough.
--
output = reverse("gro.mca" "@" "enworbbc")
http://www3.sympatico.ca/cbbrowne/x.html
Are you pondering what I'm pondering?

#4Scott Marlowe
smarlowe@qwest.net
In reply to: DEV (#1)
Re: Group by - Case insensitivity

On Mon, 2004-06-28 at 09:15, UMPA Development wrote:

Hello all!

Is it possible to setup a group by to be case insensitive and if so how?

group by lower(field)