473,804 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Group by - Case insensitivity

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

Nov 23 '05 #1
3 4840
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:
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

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #2
In the last exciting episode, de*@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.mc a" "@" "enworbbc")
http://www3.sympatico.ca/cbbrowne/x.html
Are you pondering what I'm pondering?
Nov 23 '05 #3
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)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postg resql.org so that your
message can get through to the mailing list cleanly

Nov 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
3173
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some sort? Thanks, Elliot
1
2934
by: D. Alvarado | last post by:
Hello, I'm sure this is a pretty easy question, but how would I indnicate in my XML schema that I wanted to make attribute name comparisons case insensitive? For example, is I had an element <MYELEMENT myattr="1"> I would want the "myattr" attribute to validate against <xs:schema name="MYATTR" type="xs:integer"/>
2
10317
by: Tom | last post by:
Hi, Our development team is adding DB2 8.1 compatibility to our existing application which currently supports SQLServer 2000. Our code is written to take advantage of SQLServer's ability to allow query string compares to be case insensitive. We have identified DB2 forces all query string compares to be evaluated case sensitive. Since our code is written to assume case insensitivity, it curently seems that we must change our code...
7
1715
by: Jan Nielsen | last post by:
Hi all I am learning Asp.Net using Vb.net (VS 2002). I found the following example in a book: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim count As Integer If Not Me.ViewState("Count") Is Nothing Then
6
1666
by: crosser | last post by:
I have class written in C# with elements: 1. Private variable: aaa 2. Protected overridable property AAA the only differrence in names is case sensitivity. Is it possible to shadow variable aaa in inherited class using Visual Basic ? I can't find a solution because of Visual Basic case insensitivity...
13
4724
by: Tom Anderson | last post by:
Afternoon all, MacOS X seems to have some heretical ideas about the value of case in paths - it seems to believe that it doesn't exist, more or less, so "touch foo FOO" touches just one file, you can't have both 'makefile' and 'Makefile' in the same directory, "os.path.exists(some_valid_path.upper())" returns True even when "os.path.split(some_valid_path.upper()) in os.listdir(os.path.split(some_valid_path))" returns False, etc...
15
1569
by: gregory_may | last post by:
Is there any options in VS 2005 to better handle case issues in C# (Similar to VB.Net)?
5
5365
by: Monty M. | last post by:
Hello; I was wondering if anyone can assist me with this problem. Here are the tools I am using: Language: C# Database: MS SQL Server 2000 Application: Visual Studio 2005 1. I have a table whose primary key is a varchar data type.
7
2978
by: vunet.us | last post by:
So, I came across the problem every developer comes across with once: case in SQL. My users login with their selected user name and when SQL checks for user name value, case is ignored. For example, user1 is equal to User1. This causes some problems in cases where I validate user names for authentication to access some secure files. Anyway, what can I do to make sure User1 cannot log in if database stores user1? Suggestions are very...
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.