Does anyone know why a SQL SELECT query returns no rows when SELECTing from an empty table, but when trying to SELECT the AVG from a column in an empty table it returns < null >? The difference in behavior just seems odd to me. I’m using a sqlite database if that makes any difference.
Here are the two queries:
Normal select: SELECT a FROM table1
If table1 is empty I get no rows back
Avg select: SELECT AVG(a) FROM table1
If table1 is empty I get back a < null > row.