Home > Articles

  • Print
  • + Share This
This chapter is from the book

10.5 Grouping of Null Values

If grouping is required on a column that contains null values, all these null values form one group because a GROUP BY clause applies a vertical comparison. This is in accordance with the rules described in Section 9.5.

Example 10.10: Find the different league numbers.

SELECT   LEAGUENO
FROM     PLAYERS
GROUP BY LEAGUENO

The result is:

LEAGUENO
--------
1124
1319
1608
2411
2513
2983
6409
6524
7060
8467
?

Explanation: Players 7, 28, 39, and 95 do not have a league number and, therefore, form one group (the last row) in the end result.

  • + Share This
  • 🔖 Save To Your Account