Can someone explain why, when these tables are empty, the following query returns a COUNT(*) of 0 and a MAX(Timsestamp) of null...
SELECT 'Combined', COUNT(*), MAX(Timestamp)
FROM TableA
JOIN TableB USING (Id)
...while adding a "GROUP BY" on the constant value (first column) returns no rows at all?
SELECT 'Combined', COUNT(*), MAX(Timestamp)
FROM TableA
JOIN TableB USING (Id)
GROUP BY 1
I wasn't able to find anything in the MySQL documentation explaining this behavior. (Re-posted from https://stackoverflow.com/questions/35438668/mysql-join-with-empty-tables-and-count-returns-a-row-with-0-count-but-addin)