Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

NULL with ORDER BY in Teradata

When you use an ORDER BY clause to sort records, Teradata Database sorts null as the lowest value.
If any row has a null in the column being grouped, then all rows having a null are placed into one group.

Example:
  1. SELECT id FROM tbl_emp

  1. id
  2. 1
  3. null
  4. null
  5. 2
  6. null
  7. 3


With ORDER BY:

  1. SELECT id FROM tbl_emp ORDER BY id;

Output:
  1. id
  2. 1
  3. 2
  4. 3
  5. null
  6. null
  7. null