I have a table of music tracks with a length field that stores information on how long each individual track is. I'm trying to query to database to find out the maximum track length, minimum track length and I want the return the number of tracks which have a length listed (IS NOT NULL).
Here is the statement:
SELECT MAX(length), MIN(length), COUNT(length)
FROM tracks WHERE length IS NOT NULL;
The problem is the value COUNT() returns is the exact same whether I include the IS NOT NULL operator at the end or not. The table has around 25 entries that are NULL so surely I should be getting a lower result for COUNT() when I add the NOT NULL operator to the end of the statement?