I have 2 tables - parent and child, with 2 columns in each - id and address, and address looks like this -
\partNumber\a$\sometext....\ - for child
and \partNumber\a$\ - for parent.
And I need to make a table out of it with 2 columns - for every child id I need to get its parent folder. I tried to make it like this by using sql
update work.Test
set parent_id = ( select pn.DirId
from work.Parent pn
join work.Child cn on cn.dirPath like pn.dirPath & '%');
just tried another option like this one
update work.Test
set parent_id = ( select pn.DirId
from work.Parent pn
join work.Child cn on
cn.dirPath = substr(pn.dirPath, 1, index( '%', pn.dirPath) +1));
but still the same result
And even it gives me 0 error and shows in a log that it did updates on all records, as a final result I get nothing on my table.