I want to replace always the last node in the string-
root/node1/node2
If I pass node3 as the parameter it should do a replace like this –
root/node1/node3
Can anyone help me do this say the column name was lineage and I have the id. So, the query would be –
Update
tree
set
lineage= -- replace(lineage,node3) -- this is what i need ?
where
id=2
You could do some string manipulation to find the last occurrence of a
/, and then strip everything after that point… and then append your new node parameter to that value