Suppose you have two tables:
ClassTable: classname, classid
AssignmentTable: itemname, itemid, itemcontents, classid
and you want to sort the assignments by the classname then itemname, then you would issue the following where classid is assume to link the two tables:
SELECT AssignmentTable.itemname
FROM AssignmentTable, ClassTable
WHERE AssignmentTable.classid=ClassTable.classid
ORDER BY ClassTable.classname ASC, AssignmentTable.itemname ASC |