SQL Keyword ASC

The SQL keyword ASC is used to sort the result set in ascending order, based on a specific column.

Sort By Single Column

The below SQL sorts the result set by customer name in ascending order.

Run this on IDE

SELECT * FROM customers
ORDER BY customer_name ASC;

Sort By Multiple Columns

The below SQL sorts the result set by customer name and city, both in ascending order.

SELECT * FROM customers
ORDER BY customer_name ASC, city ASC;

Related Links