Zhadus Posted March 11, 2009 Share Posted March 11, 2009 I'm new to the more advanced MySQL queries and what I currently need done I'm not even sure is possible. I want to display a list of results and ORDER BY the email field, however, I have another field that states whether the email is visible to the public or is hidden. I want to include the hidden ones in the result, but not sort it (they should appear at the bottom of the results). If this is possible, what is the general syntax? I am aware of other ways I can do it without MySQL, but this is preferred if possible. Quote Link to comment https://forums.phpfreaks.com/topic/148987-solved-mysql-query-order-by-field1-when-field2/ Share on other sites More sharing options...
Mchl Posted March 11, 2009 Share Posted March 11, 2009 Assuming hiden = 1 means email is hidden SELECT email FROM table ORDER BY private, email Quote Link to comment https://forums.phpfreaks.com/topic/148987-solved-mysql-query-order-by-field1-when-field2/#findComment-782299 Share on other sites More sharing options...
Zhadus Posted March 11, 2009 Author Share Posted March 11, 2009 Absolutely phenomenal. Thank you very much Mchl. Make it seem so easy Quote Link to comment https://forums.phpfreaks.com/topic/148987-solved-mysql-query-order-by-field1-when-field2/#findComment-782304 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.