When running a SQL query that aggregates over a field using GROUP BY and that field features a mix of datatypes (string and numerical), the results of the query are unexpected:
On the right there is only one datatype (string) in 'type' column and the query results are fine; however, on the left where there is a mix (string + num), the resulting query overwrites the value 'a' with a 0.
Is this a bug or am I misunderstanding how SQL works?
The model that recreates this behavior is attached: