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
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)