转载自IBM网站,有时候会用到
先是SQL查询的:
To create a query which returns Duplicate parent and child information in the result set:
- Create a new query.
- Select the ID field to display and select no filter fields. Run the query.
- Select the 'SQL editor' tab next to the 'Display editor' tab.
Note: If you cannot see the 'SQL editor' tab, select View > View SQL pane from the menu. Then the SQL editor tab will become available. - Make a change to the SQL command in the SQL editor tab. You will be prompted to confirm to continue.
- Select Yes and the SQL command will become editable.
- Replace the SQL command in the tab with the following SQL command using 'Ctrl + V' to paste it.
- To show all the records in duplicate state and include their parent IDs in the result set:
select distinct T1.dbid, T1.id, T2.id as "Duplicate Of"
from Defect T1, Defect T2, parent_child_links l
where T1.dbid <> 0 and (T1.dbid = l.child_dbid
and l.parent_dbid = T2.dbid and l.link_type_enum=2) - To show all the records which have duplicate records and include their duplicate IDs in the result set :
select distinct T1.dbid, T1.id, T2.id as "Duplicates"
from Defect T1, Defect T2, parent_child_links l
where T1.dbid <> 0 and (l.parent_dbid = T1.dbid
and l.child_dbid = T2.dbid and l.link_type_enum=2)
- To show all the records in duplicate state and include their parent IDs in the result set:
- Run the Query
程序方法获取,提供方法,可自己查看api说明
GetOriginal 获取父记录对象
GetOriginalID 获取父记录ID
GetDuplicates 获取子记录集合
IsOriginal 是否父记录类型
IsDuplicate 是否子记录类型