Re: MySQL: Alphabetizing title results in library format

From: Date: Fri, 02 Nov 2001 03:01:26 +0000
Subject: Re: MySQL: Alphabetizing title results in library format
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-13927@lists.php.net to get a copy of this message
Hi, seems a bit strange. Try this select (use mysql client) mysql> select title,if(title like 'The %','yes','no') from titles; if it works try substring functions and if that works try 'order by' clause. It's at least working on server v. 3.23, so in case it will not work find out in the 'list of changes' (for version 3.23) if this feature is not new. In such case tell whoever to upgrade. :( I can't find any error in your query (and at least at 3.23 it's working!) Regards On Thursday 01 November 2001 10:19, you wrote: > Petr Tuma wrote: > > What error message it produce? > > Ok, table titles is composed of: > > +----------+-------------+----------------+ > > | titlesid | releaseyear | title | > > +----------+-------------+----------------+ > > mysql> select *,(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) as sort_col from > titles order by sort_col; ERROR 1064: You have an error in your SQL syntax > near 'when title like 'The %' then substring (title, 5, 255) when title > like 'A %' the' at line 1 -- Petr Tuma IT Manager, M.Ward Manufacturing

« previous php.db (#13927) next »