SQL 删除操作的语法在Hql中报错

Hql中不能使用下面的删除语法, 但对应sql的语法是正确的。
delete c from Table1 c, Table2 d      --ERROR
where c.refId = d.id
and d.contract.id = '001'
and d.year=2010


delete c from table1 c, table2 d      --CORRECT
where c.refId = d.id
and d.contractId = '001'
and d.year=2010



Hql中要用in:
 
delete c from Table1 c                --CORRECT
where c.refId in (select d.id from Table2 d where d.contract.id = '001' and d.year=2010)

你可能感兴趣的:(sql,C++,c,C#)