Sobes.tech
Junior

What does the ORDER BY operator mean?

sobes.tech AI

Answer from AI

The ORDER BY operator in SQL is used to sort the resulting set by one or more columns.

Sorting can be:

  • Ascending (ASC - default)
  • Descending (DESC)

Example syntax:

SELECT column1, column2
FROM table_name
WHERE condition
ORDER BY column1 ASC, column2 DESC;