我正在尝试为不是主要标头记录的记录返回表的rowID。主头记录由一个或多个列标识。对于下表,主要标头记录是IDS#1、5和7行,使用列组合-(PURCHASE_ORDER_ID,GOODS_PO_LINE_ID)
查询我正在运行:
select distinct A.rowID from CLIENT.PURCHASE_ORDER_GOODS_LINES_L2 A
join CLIENT.PURCHASE_ORDER_GOODS_LINES_L2 B
on A.PURCHASE_ORDER_ID = B.PURCHASE_ORDER_ID
where A.GOODS_PO_LINE_ID = B.GOODS_PO_LINE_ID
and A.ROWID > B.ROWID;