+ 1
What is asc in mysql?
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
+ 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;