From: Martin Gainty Date: November 24 2007 3:17pm Subject: RE: Unusual sort List-Archive: http://lists.mysql.com/mysql/210179 Message-Id: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="_355ab44d-9ca9-4751-bc74-0d9d634dee07_" --_355ab44d-9ca9-4751-bc74-0d9d634dee07_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi Jim =20 it seems that you cannot create an index with a function soyou will need to= establish a separate 12 character column which has all of the URL entries = insertedalphabetically in ascending order (fully padded with www. prefix)ba= ckup your DBALTER TABLE table ADD TwelveCharacterURL CHAR(12), ADD FOREIGN KEY 12CharacterIndex (TwelveCharacterURL); UPDATE TABLE TABLE set TwelveCharacterURL=3D(LPAD(OldURLColumn,12,'www.')); =20 Anyone else? Martin ______________________________________________Disclaimer and confide= ntiality noteEverything in this e-mail and any attachments relates to the o= fficial business of Sender. This transmission is of a confidential nature a= nd Sender does not endorse distribution to any party other than intended re= cipient. Sender does not necessarily endorse content contained within this = transmission.> From: jj@stripped> To: mysql@stripped> Subject: Unusu= al sort> Date: Fri, 23 Nov 2007 16:29:50 -0700> > I have a table containing= web site host names, most of them having both a > "name.com" and "www.name= .com" version, that I'd like sorted in the > following manner:> > axxx.com>= www.axxx.com> bxxx.com> www.bxxx.com> wxxx.com> www.wxxx.com> zxxx.com> ww= w.zxxx.com> > Any way to do this? > > > -- > MySQL General Mailing List> Fo= r list archives: http://lists.mysql.com/mysql> To unsubscribe: http://lists= .mysql.com/mysql?unsub=3Dmgainty@stripped>=20 _________________________________________________________________ Your smile counts. The more smiles you share, the more we donate.=A0 Join i= n. www.windowslive.com/smile?ocid=3DTXT_TAGLM_Wave2_oprsmilewlhmtagline= --_355ab44d-9ca9-4751-bc74-0d9d634dee07_--