Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Sorting by Multiple Columns | Sorting Data
Introduction to SQL
course content

Contenido del Curso

Introduction to SQL

Introduction to SQL

1. Getting Started
3. Sorting Data
4. Populating a Database
5. Updating & Deleting Data

book
Sorting by Multiple Columns

Summary:

  • The retrieved data can be sorted with respect to the values of multiple columns as well using the ORDER BY clause;
  • The general syntax of the ORDER BY clause is: SELECT column1, column2, … FROM table_name ORDER BY columnA [ASC|DESC], columnB [ASC|DESC], …;;
  • SELECT name, age FROM students ORDER BY age, first_name.
In case of the expression `ORDER BY age, first_name`, the fetched rows are sorted first by:

In case of the expression ORDER BY age, first_name, the fetched rows are sorted first by:

Selecciona la respuesta correcta

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 3
We're sorry to hear that something went wrong. What happened?
some-alt