Is there a way to find two fields (in different tables), compare them and if they are different to perform an update? Could you give me a brief example if there is any way, using EXECUTE BLOCK
.
Is there a way to find two fields (in different tables), compare them and if they are different to perform an update? Could you give me a brief example if there is any way, using EXECUTE BLOCK
.
Something like this:
execute block
as
begin
IF ( (select numero from btr01 where numero=150000) = (select numero from btr01 where numero=150001))
THEN update btr01 set serie='123' where numero=150000;
ELSE update btr01 set serie='321' where numero=150001;
end