How to ordering results by specific field values in MySQL.

Опубликовано: 03 Декабрь 2019
на канале: TechiesBadi
305
0

How to ordering results by specific field values in MySQL.
-------------------------------------------------------------------------------------------
Generally we can ordering the results either Ascending / Descending.
But we can order by our own order also i,e custom order.
Here i taken the two tables

1) roles
2) users
roles table having some the roles names these are mapped in the users table.
Now i want to join these two tables
Now i will apply the general Asc and Desc orders

in Asc order the data will display 1,2,3,4,5
in Desc order the data will display 5,4,3,2,1
But i want to display the data in my own order i.e 3,2,4,1,5

For that we need to use the Field() function.


Смотрите видео How to ordering results by specific field values in MySQL. онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь TechiesBadi 03 Декабрь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 305 раз и оно понравилось 0 людям.