ORDER BY col1,col2,col3,col4,.....
this will sort the list by column 1, then sort withing those by column two.
For example if you had this table
CREATE TABLE IF NOT EXISTS cars (
ID BIGINT NOT NULL auto_increment,
CarMake VARCHAR(255) NOT NULL,
CarModle VARCHAR(255) NOT NULL,
CarYear CHAR(4) NOT NULL,
PRIMARY KEY (ID),
INDEX CarMake (CarMake),
INDEX CarModle (CarModle),
INDEX CarYear (CarYear)
)
and it contained the data
1, Kia, Sephia, 1997
2, Kia, Rio, 2000
3, Kia, Sephia, 2000
then this
SELECT * FROM cars ORDER BY CarMake,CarModle,CarYear
It will return this
2, Kia, Rio, 2000
1, Kia, Sephia, 1997
3, Kia, Sephia, 2000