-
SQL Multiple Column Sorting Explained
SQL Multiple Column OrderingIn SQL, when you want to sort the results of a query based on multiple columns, you use the ORDER BY clause followed by a comma-separated list of columns
-
Unlocking the Mystery: Ordering with Nulls Last in SQL's Ascending Sort
Using NULLS LAST (or NULLS FIRST): This is the most straightforward method for some database systems like PostgreSQL and Oracle
-
Unlocking Natural Sorting: Techniques for Alphanumeric Data (SQL Server 2005)
Imagine a column containing product codes like "A1", "A10", "A11", "B2", "AB1", "AB10", "AB20".Default sorting would order them alphabetically: "A1", "A10", "A11", "AB1", "AB10", "AB20", "B2"
-
UNION with Order: Mastering the Art of Combining and Sorting SQL Results
This explanation details the challenges of using ORDER BY with UNION and provides solutions for achieving the desired order
-
Taming the Chaos: Solutions for Natural Sorting in MySQL
Imagine you have a table containing product versions:| Version | |---|---| | v1. 2 | | v2. 0 | | v10. 1 | | v9. 9 |Sorting this table by the Version column using the default method would result in: