+ 1

What is asc in mysql?

4th Feb 2020, 10:55 AM
Rajat Kumar pal
Rajat Kumar pal - avatar
2 Antworten
+ 3
ASC = ascending order ( 1 -> 10) - ( A -> Z) DESC = Descending order (10 -> 1) - (Z - A) Given sample int data and using SORT ASC: Data: 5 2 1 3 4 Output: 1 2 3 4 5 Same with names Data: a c b d Output: a b c d DESC will do the opposite Data: 1960 1990 1977 2005 Output: 2005 1990 1977 1960
4th Feb 2020, 11:39 AM
HNNX 🐿
HNNX 🐿 - avatar
+ 2
'asc' is for sorting in ascending order. 'desc' is for sorting in descending order. But you must always use a column name with it for it work. Eg- Order by column_name desc;
4th Feb 2020, 11:40 AM
Avinesh
Avinesh - avatar