Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Petr Tuma
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 o

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Bill Morrow
On Thu, Nov 01, 2001 at 04:43:00AM -0500, Ian Evans wrote: > Cami wrote: > > > Try this: > > 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 e

RE: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Cami
t_col; I can't tested, but that's what the manual say. Cami -Original Message- From: Ian Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 9:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL: Alphabetizing title results in library format Petr Tuma wrote:

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Ian Evans
Cami wrote: > Try this: > 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; Argh, that still prod

RE: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Cami
ope it helps, Cami -Original Message- From: Ian Evans [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 9:20 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] MySQL: Alphabetizing title results in library format Petr Tuma wrote: > What error message it produ

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-11-01 Thread Ian Evans
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) wh

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-10-31 Thread Petr Tuma
Hi, there was an typing error 'from Title' should be 'from Titles'. Anyway it's working for me. What error message it produce? On Thursday 01 November 2001 05:09, you wrote: > Petr Tuma wrote: > > select *,(case when Title like 'The %' then substring (Title, 5, 255) > > > > ETC. > > Alas, My

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-10-31 Thread Ian Evans
Petr Tuma wrote: > select *,(case when Title like 'The %' then substring (Title, 5, 255) > ETC. Alas, MySQL doesn't like that syntax either. :( -- Ian Evans Digital Hit Entertainment - News and Information http://www.digitalhit.com -- PHP Database Mailing List (http://www.php.net/) To u

Re: [PHP-DB] MySQL: Alphabetizing title results in library format

2001-10-31 Thread Petr Tuma
Hi, I would assume that MySQL doesn't support functions in the 'order by' clause. Try this: 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_co