Re: MySQL: Alphabetizing title results in library format

From: Date: Thu, 01 Nov 2001 11:03:18 +0000
Subject: Re: MySQL: Alphabetizing title results in library format
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-13909@lists.php.net to get a copy of this message
I'm new so I could be totally off track here but could you not use the php string manipulation functions in conjunction with strtoupper() to produce the desired result prior to inserting in the db? "Ian Evans" <ianevans@friedspamdigitalhit.com> wrote in message news:3BE07E63.6030808@friedspamdigitalhit.com... > Back when I was working with MSSQL I need to alphabetize movie titles in > the proper library format where 'A' 'An" and 'The" are ignored. > > For MSSQL I was told to use: > select * > from Titles > order by case when Title like 'The %' then substring (Title, 5, 255) > when Title like 'A %' then substring (Title, 3, 255) > when Title like 'An %' then substring (Title, 4, 255) > else Title > end > > That worked like a charm, yet MySQL doesn't seem to accept that. Any > solutions or advice? > > -- > Ian Evans > Digital Hit Entertainment - News and Information > http://www.digitalhit.com >

« previous php.db (#13909) next »