Received: from mail6.maine.rr.com (mail.maine.rr.com [204.210.65.65]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f94KpRn70275 for ; Thu, 4 Oct 2001 16:51:27 -0400 (EDT) (envelope-from swerdlow@maine.rr.com) Received: from RSWERDLOW800 ([24.93.133.137]) by mail6.maine.rr.com (Post.Office MTA v3.5.3 release 223 ID# 0-59787U250000L250000S0V35) with SMTP id com; Thu, 4 Oct 2001 16:51:24 -0400 Message-ID: <02b101c14d16$f5c37050$6301a8c0@RSWERDLOW800> From: "Bob Swerdlow" To: "Jason Earl" , References: <20011004194746.21583.qmail@web10004.mail.yahoo.com> Subject: Re: ORDER BY case insensitive? Date: Thu, 4 Oct 2001 16:55:51 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Archive-Number: 200110/82 X-Sequence-Number: 5038 Thanks for the suggestion, Jason. A co-worker of mine, however, had this response: Yes, but my guess is that that will first convert all million (or whatever) records to upper case, and then physically sort them. It won't be able to make use of the index. To make this efficient, do we need to uppercase all of the data before adding to the table? (yuk) - Bob ----- Original Message ----- From: "Jason Earl" To: "Bob Swerdlow" ; Sent: Thursday, October 04, 2001 3:47 PM Subject: Re: [SQL] ORDER BY case insensitive? > SELECT * FROM MyTable ORDER BY lower(Name); > > Should do the trick. > > Jason Earl > > --- Bob Swerdlow wrote: > > How do I get the rows sorted in a case insensitive > > way? > > > > I have some queries that basically fit the form: > > SELECT * FROM MyTable ORDER BY Name; > > When I view the results, all of the Name's that > > start with an upper case > > letter precede all of the Name's that start with a > > lower case letter. I > > want them all in alphabetic order, regardless of > > case. > > > > I've looked in PostgreSQL Introduction and Concepts > > by Bruce Momjian and in > > the FAQ at > > http://postgresql.overtone.org/docs/faq-english.html > > > > Thanks for your help. > > > > -- > > Bob Swerdlow > > Chief Operating Officer > > Transpose, LLC > > rswerdlow@transpose.com > > > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > TIP 6: Have you searched our list archives? > > > > http://archives.postgresql.org > > > __________________________________________________ > Do You Yahoo!? > NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. > http://geocities.yahoo.com/ps/info1 >