Skip to content

Commit 33f36c1

Browse files
authored
pencil edit
1 parent 092b7a3 commit 33f36c1

File tree

1 file changed

+2
-2
lines changed
  • learn-pr/azure-databases/postgresql/basic-sql-limit-offset-order-by/includes

1 file changed

+2
-2
lines changed

learn-pr/azure-databases/postgresql/basic-sql-limit-offset-order-by/includes/3-order-by.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ORDER BY country, city;
3232

3333
This query retrieves all columns `(*)` from the `sales.customers` table and then sorts the resulting rows.
3434
The sorting is done in two levels:
35-
1. First, the results are sorted alphabetically by the country column. This means all customers from "Argentina" will be grouped together, followed by customers from "Austria," and so on.
36-
1. Within each group of customers from the same country, the results are further sorted alphabetically by the city column. So, if you have multiple customers from "Germany," they'll be ordered by their city names (for example, "Aachen" before "Berlin").
35+
- First, the results are sorted alphabetically by the country column. This means all customers from "Argentina" will be grouped together, followed by customers from "Austria," and so on.
36+
- Within each group of customers from the same country, the results are further sorted alphabetically by the city column. So, if you have multiple customers from "Germany," they'll be ordered by their city names (for example, "Aachen" before "Berlin").
3737

3838
In essence, this query provides a customer list that is organized primarily by `country` and then, within each `country`, organized by `city`. This makes it easy to find customers from a specific region.
3939
Additionally, combining this approach with `ASC` or `DESC` modifiers allows full control over the sorting direction for each column.

0 commit comments

Comments
 (0)