ORDER BY ASC sorts query results from lower to higher values for numeric data and from earlier to later or alphabetically depending on the data type.
Sorting makes query results easier to understand and is essential for ranking, reporting, and analysis.
Display employees from the lowest salary to the highest salary.
SELECT
EmployeeName,
Salary
FROM Employees
ORDER BY Salary ASC;
Ascending sorting is useful for salary analysis, dates, transaction values, customer names, and operational reports.
- ASC means ascending order.
- ASC is the default ORDER BY direction in many databases.
- Numbers normally go from low to high.
- Text is commonly sorted alphabetically.
- Dates are commonly sorted from earlier to later.
What does ASC mean?
ASC means ascending order.
Is ASC required in every ORDER BY query?
No. ASC is commonly the default sort direction, so it can often be omitted.