5 Replies Latest reply on Dec 30, 2013 10:19 PM by Steven Hawkins

    Teiid exception in SubQuery

    John Khoury Newbie

      Hi there,


      I am getting an exception with and Sql query that contains a sub-query.


      SELECT Bank.Code AS Bank_Code,

             (SELECT avg(Bank_sub.n) 

                FROM  Bank Bank_sub

               WHERE (Bank_sub.Code = Bank.Code))

                AS Field4

      FROM  Bank Bank

      GROUP BY Bank.Code


      org.teiid.jdbc.TeiidSQLException: TEIID30504data: 1054 TEIID11008:TEIID11004 Error executing statement(s):

      [Prepared Values: [] SQL: SELECT g_0.`Code`, (SELECT AVG(g_1.`n`) FROM `data`.`Bank` AS g_1 WHERE g_1.`Code` = anon_grp0.gcol0) FROM `data`.`Bank` AS g_0 GROUP BY g_0.`Code`].