2012-01-09 108 views
2

我想根据某些标准将一个表的外键插入另一个表的外键。结构就像子查询查询中的HQL限制

insert into CustomerResult(customer,draw) select c.idCustomer, from Customer c,Draw d where ..... and c.idCustomer in (select cc.idCustomer from Customer cc where ..... limit 10) 

这里我想插入只修复符合特定条件的记录号。我知道hql没有限制关键字,但希望像这样实现。任何建议?

回答