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:
- SELECT id FROM tbl_emp
- id
- 1
- null
- null
- 2
- null
- 3
With ORDER BY:
- SELECT id FROM tbl_emp ORDER BY id;
Output:
- id
- 1
- 2
- 3
- null
- null
- null