**Patrick Earl** created an [issue](https://nhibernate.jira.com/browse/NH-2951) — <time datetime="2011-11-21T23:29:06.164Z" title="2011-11-21T23:29:06.164Z">21st November 2011, 23:29:06</time>: > QbCustomer inherits from QbEntity and both tables have the Id field. > > HQL is: > ```sql > update QbInvoice i set i.Customer = (select c from QbCustomer c where c.QbId = ?) where i.QbId = ? > ``` > In the generated query, the "Id" field is missing the alias and is ambiguous. > ```sql > update "QbInvoice" set "CustomerId"= > (select "Id" > from "QbCustomer" qbcustomer1_ > inner join "QbEntity" qbcustomer1_1_ on qbcustomer1_."Id"=qbcustomer1_1_."Id" > where qbcustomer1_1_."QbId"=?) where "QbId"=? > ``` > --- **Patrick Earl** added a comment — <time datetime="2011-11-22T00:26:10.817Z" title="2011-11-22T00:26:10.817Z">22nd November 2011, 0:26:10</time>: > Using (select c.Id ...) is a workaround for this problem. A failing test has been committed. >