2011-06-16 44 views
0

我有一個Excel的Excel工作表,每個人都有一個父親和一個母親在同一個信息表中。我EXEL表看起來像這樣:電水壺/自動參考表

永世 --- 父親 --- 母親

約翰--------託尼-----簡

託尼--------插孔

我想的DATAS導入到看起來像一個Oracle數據庫表:

--- 永世 --- 父親 --- 母親

0 -----插孔

1 -----託尼------- - 0

2 ----- jane

什麼應該是我的工作流程?

3 ---- --------約翰1 ----------- 2

回答

0

它將由數據加載到表更容易至少開始與代孕ID:

people father mother 
------ ------ ------ 
john tony jane 
tony jack 

然後你可以爲父親和母親已經在「人」列中添加行不:

insert into mytable (people) 
(select mother from mytable 
    union 
    select father from mytable 
) 
minus 
select people from mytable; 

這會給你:

people father mother 
------ ------ ------ 
jack 
tony jack 
jane 
john tony jane 

然後,您可以爲每一行添加一個代理ID,並使用它替代,如果您需要的話。