Dnia 2004-02-01 14:34, Użytkownik Michael Fuhr napisał:
Consider storing the session in a separate field and assigning each
session a value that collates in the order you want.

Here's a way to order the sessions using their current format:

SELECT *
FROM records
ORDER BY lastName,
         firstName,
         SUBSTRING(term FROM 1 FOR 4),
         CASE SUBSTRING(term FROM 5)
           WHEN 'S' THEN 1
           WHEN 'X' THEN 2
           ELSE 3
         END;

or the easier one:


order by lastname,firstname, translate(term,'SXF','123');

Regards,
Tomasz Myrta


---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings

Reply via email to