https://praveenkumarbommisetty.graphy...
"Ever noticed how NULL values in SQL behave weirdly when sorting data? Today, let’s break down NULLS FIRST and NULLS LAST – and how you can control where NULLs appear when sorting results."
"NULL means unknown or missing value. It’s not zero, and it’s not an empty string — it literally means nothing is stored in that field."
"By default, when you ORDER BY, most SQL databases place NULLs last in ascending order, and first in descending order."
SELECT * FROM employees ORDER BY salary ASC NULLS FIRST;
"Use NULLS FIRST to push NULL values to the top, even in ascending order."
SELECT * FROM employees ORDER BY salary DESC NULLS LAST;
"And NULLS LAST forces NULLs to the bottom, even when sorting in descending order."
#nvl
#nvl2
#what is null in sql
#coalesce
#is null
#is not null
In questa pagina del sito puoi guardare il video online SQL Nulls First Nulls Last - Null Sorting in SQL della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Praveen Kumar Bommisetty 21 maggio 2025, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 286 volte e gli è piaciuto 8 spettatori. Buona visione!