Split word with condition
shashank_p
Vertica Customer ✭
As mentioned below is my requirement for one column data.
Example 1
original value: agricultural & manufacturing reforms
required value: agricultural reforms & manufacturing reforms
Example 2
original value: manufacturing & construction sectors
required value: manufacturing sectors & construction sectors
Need below answers-
1. First can we identify data of this sort in Vertica.
2. If we identified data of this sort then can we get required value using formula.
3. How can we generalize this by a formula for a particular column data.
Kindly assist and let me know if you have any questions.
Tagged:
0
Answers
I would try
REGEXP_REPLACE()
as a function:src | tgt |
-------------------------------------+---------------------------------------------
agricultural & manufacturing reforms | agricultural reforms & manufacturing reforms
manufacturing & construction sectors | manufacturing sectors & construction sectors
It helped! and to identify such data I used REGEXP_COUNT