beginner - ORDER BY

Honza Pazdziora adelton na informatics.muni.cz
Středa Listopad 28 09:34:38 CET 2001


On Wed, Nov 28, 2001 at 08:40:50AM +0100, Jan Serak wrote:
> Martin Reiser wrote:
> > 
> > Potrebuji upravit jednu aplikaci v PHP, kterou jsem nepsal,
> > a mam pole ID, ktere vypada treba "23/01" (cislo/rok)
> > tedy od roku 99 dale, take xx/99, xx/00, xx/01 ...
> > potrebuji radit podle roku sestupne a potom podle cisla
> 
> ORDER BY substr(id,4),substr(id,1,2)

Plus nejaky case when to_number(substr(id, 4)) > 50 then 100 +
to-Number(substr(id, 4)) else to_number(substr(id, 4)) end
[netestovano] na rozliseni roku mensiho nez 50 a vetsiho nez
padesat.

-- 
------------------------------------------------------------------------
 Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, DBD::XBase.
------------------------------------------------------------------------


Další informace o konferenci Test