You want to sort the records then MySQL ORDER BY is the keyword to use.
You wish to specify the result arrangement which the MySql Select Command Query selects data from database.
Example
SELECT * FROM Paymentmethod
ORDER BY paymenttype;
The sorting arrangement which the records or data selected and display are specified using a MySQL Keyword called ORDER BY.
2 Orders it sorts records are:
- Ascending (asc) order
- Descending (desc) order
You know that by default that the keywords sorts record in DESC(descending) order.
But to modify the order you may prefer to specify either ASC or DESC with represents ascending or descending respectively.
See the below code:
SELECT * FROM Paymentmethod
ORDER BY paymenttype ASC;
ORDER BY ASC
SELECT * FROM Paymentmethod
ORDER BY paymenttype DESC;
ORDER BY DESC