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

 

 

Comments

comments

phpexpertise

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