How to Update a table field matching with another records of same table.
UPDATE XXXRLES
SET BIZCAT05 = 'S'
WHERE ( SELECT A.* FROM XXXRLES A, XXXRLES B
WHERE
A.BIZFLD = B.BIZFLD
AND A.BIZOBJ = B.BIZOBJ
AND A.BIZRUL = B.BIZRUL
);
I need to update Field BIZCAT05 by ‘S’ of table XXXRLES if and only if 2 records having the same values for the following 3 Fields as:
BIZFLD
BIZOBJ
BIZRUL
How to make this query?
I’ve assumed that your RDBMS is Oracle after you’ve mentioned
ROWIDin comment.or using
exists(which looks clearer, at last for me):Added after comment:
I’m not familiar with DB2 but you can try: