Could you do something like select title from foo order by replace(title, 'The ', ''); ?? Or add a order_by column
On Wed, Jul 23, 2008 at 8:49 AM, Sherief N. Farouk <[EMAIL PROTECTED]> wrote: > Can you define a custom less-than operator for sorting? If this were C++, > I'd do std::sort(Result.begin(), Results.end(), MyCustomOperator()); > > - Sherief > >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:sqlite-users- >> [EMAIL PROTECTED] On Behalf Of Andrew Gatt >> Sent: Wednesday, July 23, 2008 9:41 AM >> To: General Discussion of SQLite Database >> Subject: Re: [sqlite] Ignoring "The" >> >> >> >> I have a table of music artist names which i'd like to output in >> order. >> >> Normally i just use: >> >> >> >> select * from artists order by artist_name; >> >> >> >> What i'd really like to do is order the artists by name but ignore >> any >> >> "the" or "the," preceding it. >> >> >> >> Any ideas? >> >> >> >> Thanks >> >> >> >> Andrew >> >> >> >> >> > Store it like "Beatles, The" them make the transformation latter, if >> > necessary? >> > >> > That's one idea. >> > >> > Best, >> > Daniel >> > >> > >> Thanks for the reply, I may be able to use this approach in future. But >> there are already many entries in the table and so an SQL statement >> that >> does it for me would be good! >> >> Andrew >> _______________________________________________ >> sqlite-users mailing list >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users