Is it a standard behavior for HeidiSQL not to override fields that should be overriden in the result set?
I run SQL query, where two tables have the same fields, one table is main and other is from join. I have to select all fields from main table (e.g. use "*"), and some fields from joined table must override values of main table. And it actually works when we fetch results with PDO (cause as a result we got an array value with the same key overrides previous one). but in HeidiSQL I got this:
Ok, got it by myself. According to documentation:
MySQL permits duplicate column names. That is, there can be more than one select_expr with the same name. This is an extension to standard SQL. Because MySQL also permits GROUP BY and HAVING to refer to select_expr values, this can result in an ambiguity:
SELECT 12 AS a, a FROM t GROUP BY a;
In that statement, both columns have the name a. To ensure that the correct column is used for grouping, use different names for each select_expr.
I haven't attached importance to this before.