[thelist] Q on SQL 'ORDER BY' - part 2

jsWalter jsWalter at torres.ws
Sun Apr 11 10:51:26 CDT 2004

That's it!

Thanks Hassan.

After trying to understand your example and reading the dox for about 30
minutes, I decided just to play with the query.

Your "hint" gave me this...

    SELECT contacts.con_id, contacts.con_name,
           contacts.con_title, contacts.st_id,

    FROM contacts, stations

    WHERE contacts.st_id = stations.st_id

    ORDER BY IF ( contacts.con_name = '', contacts.con_title,
contacts.con_name );

Works like a charm!

Thanks again!


More information about the thelist mailing list