How to get duplicate sub string in DB2 sql my scenario is that, I have one column
| ABC_1 |
| ABC_3 |
| WXY_5 |
I want to get only Duplicate sub string data with there addition of remaining sub values
String addition of sub string values
| ABC | | 4 |
| WXY | | 5 |
4 is the addition of duplicate sub string value for that I have used query is that SUM(CAST(SUBSTR(a.ref1, LOCATE(’-’,a.ref1)+1) as DECIMAL)) as output
but how to do it ?
Please give me a any suggestion ?