Friday, April 22 2016

Custom order by query by field name in mysql

In MySql select query we can customize the order of display the result as our wish. The following query I hope it will give some clear ideas do more thoughts in your future queries.

For example:

SELECT * FROM users_ranking 
ORDER BY field(rank_position,'1','2','3','6','4','5'),email ASC

 

 

Share Your Thoughts

phpexpertise

I’m Blogger and Programming Blog, Tutorials, PHP, MySQL, jQuery, Laravel, Wordpress and Codeigniter