-
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 Flexibility: Using DISTINCT ON for Distinct Rows with Custom Ordering in PostgreSQL
In PostgreSQL, DISTINCT ON is a window function that helps you retrieve distinct rows based on specific criteria while maintaining a desired order
-
MySQL: Mastering NULL Value Handling in ORDER BY for Numbers (NULLs Last)
In MySQL, NULL values are considered lower than any non-NULL values.This means by default: In ascending (ASC) order, NULLs appear first
-
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
-
Workarounds for Ordering Results Based on the IN List in PostgreSQL
However, there are some workarounds to achieve a similar effect in PostgreSQL: