Perhaps the simplest and most elegant solution would be to add a field to your locations table which is used for the ORDER BY expression. For instance:
ALTER TABLE locations ADD COLUMN order_by INT UNSIGNED NOT NULL;
Then, you could update this field for each of the records, like so:
UPDATE locations SET order_by = 1 WHERE location = 'd';
UPDATE locations SET order_by = 2 WHERE location = 'a';
UPDATE locations SET order_by = 3 WHERE location = 'c';
UPDATE locations SET order_by = 4 WHERE location = 'b';
Then, when doing SELECTs, simply ORDER BY this new field:
SELECT l.notes FROM locations l
WHERE l.location IN ('a','b','c','d')
ORDER BY order_by ASC;
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com