I have a MySql view defined basically in this way
CREATE VIEW viewexample AS
SELECT
CONCAT(a.ID,d.ID) as ID
FROM`TBLA` a
INNER JOIN `TBLD` d ON ...
group by a.ID,d.ID
It is working perfectly in a MySql 5.6.21 server, I can perform select * from viewexample where ID = 123456
without any problem.
Now, I migrated to a MySql 10.4.11-MariaDB Server, with the same view definition.
I can perform ok select * from viewexample
, but if I execute select * from viewexample where ID= 123456
I'm getting the 1052 error
SQL Error (1052): Column 'ID' in order clause is ambiguous
If I remove the group by clause it works.
If I change my view definition to
CREATE VIEW viewexample AS
SELECT
CONCAT(a.ID,d.ID) as ID2
FROM`TBLA` a
INNER JOIN `TBLD` d ON ...
group by a.ID,d.ID
select * from viewexample where ID2= 123456
works perfectly fine.
I guess that would be my solution for now, but I'm really very curious about this issue. Am I missing any new rule on the newest MySql version?