I'd like to get a list of product Ids in my table that has duplicate XML values in CLOB. How can I achieve that in Oracle SQL? Records only with duplicate values in the XML must be returned by the query.
Duplicate products are:
- Same Product Type "productType"
- Same Status "status"
- Same Location "location"
Below is the sample XML stored in the CLOB: List of products is not limited to 6 only, it could be many.
Table: PRODUCT, Primary Key: PR_ID
I just wanted to get the records that contains duplicate products so I can remove duplicates later on.
<productInfo>
<product>
<productType>FRNC</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
<product>
<productType>FRNC</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
<product>
<productType>FRNC</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
<product>
<productType>ABCD</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
<product>
<productType>ABCD</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
<product>
<productType>RCFT</productType>
<status>ACTV</status>
<location>BASEMENT</location>
</product>
</productInfo>