The NULL Problem in SQL ORDER BY (Why NULLS FIRST and LAST Exist) #sql

preview_player
Показать описание


Do you understand SQL but still cannot write SQL queries correctly ?
Are you afraid to switch jobs because of the SQL interview rounds or have you failed SQL Interview earlier ?
If you are someone who understands SQL and need more confidence to solve SQL queries correctly, I would like to share my recent online course especially created for you.
In this video I have tested 3 points mentioned in the Course for ORDER BY section.

1) Column names can be used even when a column is not present in the SELECT statement for sorting. But with column position, column must exist in SELECT.

2) NULL is treated as the biggest value by default in most of the databases during ORDER BY.

3) Be mindful of the NULL values in the ORDER BY columns. You may specify NULL to appear first or at last in the output by using NULLS FIRST or NULLS LAST in some databases.
Рекомендации по теме