2012-01-09 129 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沒有限制關鍵字,但希望像這樣實現。任何建議?

回答