【CQ】如何查询duplicate类型的上下游数据
2011-06-29 11:17
393 查看
转载自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:
To show all the records which have duplicate records and include their duplicate IDs in the result set :
Run the Query
程序方法获取,提供方法,可自己查看api说明
GetOriginal 获取父记录对象
GetOriginalID 获取父记录ID
GetDuplicates 获取子记录集合
IsOriginal 是否父记录类型
IsDuplicate 是否子记录类型
先是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) |
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) |
程序方法获取,提供方法,可自己查看api说明
GetOriginal 获取父记录对象
GetOriginalID 获取父记录ID
GetDuplicates 获取子记录集合
IsOriginal 是否父记录类型
IsDuplicate 是否子记录类型
相关文章推荐
- 如何在Access2007中使用日期类型查询数据
- mybatis查询如何返回List<Map>类型数据
- [Python]Python/PHP如何查询sql server中NTEXT类型数据
- ASP中如何查询日期类型的数据
- 数据类型为NTEXT,用SELECT查询时如何判断字段是否为空
- SQL语句:orac 3ff0 le中如何插入Date类型的数据和根据Date数据进行查询的方法
- 如何查询日期类型的数据?
- [Python]Python/PHP如何查询sql server中NTEXT类型数据
- [Python]Python/PHP如何查询sql server中NTEXT类型数据
- 2017-05-18 每日一记 如何在Navicat中查询blob类型数据
- ASP中如何查询日期类型的数据
- mybatis查询如何返回List<Map>类型数据
- MySQL如何创建数据库并查询数据类型
- 如何查询日期类型的数据?
- [Python]Python/PHP如何查询sql server中NTEXT类型数据
- SQL C# nvarchar类型转换为int类型 多表查询的问题,查询结果到新表,TXT数据读取到控件和数据库,生成在控件中的数据如何存到TXT文件中
- mybatis查询如何返回List<Map>类型数据
- ASP中如何查询日期类型的数据
- [Python]Python/PHP如何查询sql server中NTEXT类型数据
- 关于SpringMVC中如何把查询数据全转成String类型