refer to topic http://www.avaje.org/topic-144.html
SQL> ;1 select * from (2 select a.id, b.id3 from my_p a4 join my_person b on b.id = a.id5* )SQL> /select * from (*ERROR at line 1:ORA-00918: column ambiguously defined
The solution will be to always have a column alias EXCEPT for subQueries.
That is if you use the in subQuery expression on the where clause Ebean will not add column alias for the subQuery columns.
Query subQuery = Ebean.createQuery(Product.class) .select("id").where().idEq(4).query(); List list = Ebean.find(MinCustomer.class) .where().in("id", subQuery).findList();
select c.id c0, c.name c1, c.notes c2 from o_customer c where (c.id) in (select p.id from o_product p where p.id = ? )
Ebean will always include a column alias except for sub queries.