eleven0 Posted March 9, 2008 Share Posted March 9, 2008 I'm trying to list all of my members from my database according to their ranks. I have a column where i keep all of my ranks for each person. They are more than ten. Here are the ranks; Cpt. 1lt. 2lt. FSgt. and so on.. Quote Link to comment Share on other sites More sharing options...
Barand Posted March 9, 2008 Share Posted March 9, 2008 SELECT * FROM members ORDER BY FIELD(rank, 'Cpt.', '1lt.', '2lt.', 'FSgt.') Quote Link to comment Share on other sites More sharing options...
eleven0 Posted March 10, 2008 Author Share Posted March 10, 2008 Thank you Barand. Quote Link to comment Share on other sites More sharing options...
eleven0 Posted March 10, 2008 Author Share Posted March 10, 2008 Would this work if there were two fields? Quote Link to comment Share on other sites More sharing options...
Barand Posted March 10, 2008 Share Posted March 10, 2008 .... ORDER BY FIELD(rank, 'Cpt.', '1lt.', '2lt.', 'FSgt.') , otherfield Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.