Missing amounts do not behave like zero; this engine places NULL after known amounts when sorting.

highlighted = computed this step

Input table

Start with orders where one amount is NULL.

Orders with a missing amount\text{Orders with a missing amount}
Orders with missing amountorder_idcategoryamounto1book30o2penNULLo3book12o4paper45

Order query

Sort by amount ascending using the engine's NULL-last rule.

ORDER BY amount ASC, NULL last\text{ORDER BY amount ASC, NULL last}
ORDER BY amount ascending with NULLorder by amount ascarity 3 rows 4OrdersWithMissingarity 3 rows 4

Ordered output

Known amounts appear from low to high, and the missing amount stays last.

known amounts then NULL\text{known amounts then NULL}
Ordered outputorder_idcategoryamounto3book12o1book30o4paper45o2penNULL