I tried with the same query and i got the Same Error [i think this error is related to the Group BY ] :
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'anon_grp0.gcol0' in 'where clause'
... 13 more
John & Joseph,
Can you double check if the translator name on your model is set to "mysql" or "mysql5"?
If you attach your VDB (only if it can be shared openly), or if you can duplicate this with a sample Dynamic VDB, post that. We can check if this is bug vs usage error.
This is a bug, but not one that I've seen before. [TEIID-1680] issues with correlation and aggregation - JBoss Issue Tracker covers a known planning issue that affects correlated aggregates - but here you are correlated on a grouping expression. It appears to still occur on latest. What version are you on? Can you log an issue?
It should be possible to use a workaround with an inline view such as:
FROM Bank Bank_sub
WHERE (Bank_sub.Code = Bank_Code))
FROM (SELECT Bank.Code AS Bank_Code FROM Bank GROUP BY Bank.Code) AS V
mysql5 as translator, and 8.6 as version