mysql> select * from driver_log order by name;
+--------+-------+------------+-------+
| rec_id | name | trav_date | miles |
+--------+-------+------------+-------+
| 1 | Ben | 2006-08-30 | 152 |
| 9 | Ben | 2006-09-02 | 79 |
| 5 | Ben | 2006-08-29 | 131 |
| 8 | Henry | 2006-09-01 | 197 |
| 6 | Henry | 2006-08-26 | 115 |
| 4 | Henry | 2006-08-27 | 96 |
| 3 | Henry | 2006-08-29 | 300 |
| 10 | Henry | 2006-08-30 | 203 |
| 7 | Suzi | 2006-09-02 | 502 |
| 2 | Suzi | 2006-08-29 | 391 |
+--------+-------+------------+-------+
10 rows in set (0.00 sec)
mysql> select * from driver_log order by field(name,'Suzi','Ben','Henry');
+--------+-------+------------+-------+
| rec_id | name | trav_date | miles |
+--------+-------+------------+-------+
| 2 | Suzi | 2006-08-29 | 391 |
| 7 | Suzi | 2006-09-02 | 502 |
| 1 | Ben | 2006-08-30 | 152 |
| 9 | Ben | 2006-09-02 | 79 |
| 5 | Ben | 2006-08-29 | 131 |
| 8 | Henry | 2006-09-01 | 197 |
| 6 | Henry | 2006-08-26 | 115 |
| 4 | Henry | 2006-08-27 | 96 |
| 3 | Henry | 2006-08-29 | 300 |
| 10 | Henry | 2006-08-30 | 203 |
+--------+-------+------------+-------+
10 rows in set (0.00 sec)
mysql> select * from driver_log order by field(name,'Suzi','Ben');
+--------+-------+------------+-------+
| rec_id | name | trav_date | miles |
+--------+-------+------------+-------+
| 10 | Henry | 2006-08-30 | 203 |
| 8 | Henry | 2006-09-01 | 197 |
| 6 | Henry | 2006-08-26 | 115 |
| 4 | Henry | 2006-08-27 | 96 |
| 3 | Henry | 2006-08-29 | 300 |
| 7 | Suzi | 2006-09-02 | 502 |
| 2 | Suzi | 2006-08-29 | 391 |
| 5 | Ben | 2006-08-29 | 131 |
| 9 | Ben | 2006-09-02 | 79 |
| 1 | Ben | 2006-08-30 | 152 |
+--------+-------+------------+-------+
10 rows in set (0.00 sec)
mysql> select * from driver_log order by field(name,'Suzi','Ben') desc;
+--------+-------+------------+-------+
| rec_id | name | trav_date | miles |
+--------+-------+------------+-------+
| 1 | Ben | 2006-08-30 | 152 |
| 9 | Ben | 2006-09-02 | 79 |
| 5 | Ben | 2006-08-29 | 131 |
| 2 | Suzi | 2006-08-29 | 391 |
| 7 | Suzi | 2006-09-02 | 502 |
| 8 | Henry | 2006-09-01 | 197 |
| 6 | Henry | 2006-08-26 | 115 |
| 4 | Henry | 2006-08-27 | 96 |
| 3 | Henry | 2006-08-29 | 300 |
| 10 | Henry | 2006-08-30 | 203 |
+--------+-------+------------+-------+
10 rows in set (0.00 sec)