Tuesday, September 9, 2014

Update One row from another row in same table in MySQL



Update the row with rank column with "Limited Term Senior Lecturer" from the row
 "Limited Term Lecturer" in same table contract_has_inserts as:
UPDATE contract_has_inserts as t1 INNER JOIN contract_has_inserts as t2 ON t1.Name = t2.Name SET t1.Insert = t2.Insert, t1.Header=t2.Header
WHERE t1.Rank="Limited Term Senior Lecturer" AND t1.ContractStatus="NEW" AND
t2.ContractStatus="New" AND t2.Rank="Limited Term Lecturer"
AND
(t2.Name = "Offer" OR t2.Name ="Responsibilities" OR t2.Name ="Freedom of Information"
OR t2.Name ="Membership" OR
t2.Name ="Closing Paragraph" OR t2.Name="Acceptance of Offer" OR t2.Name="Copyright")


No comments:

Post a Comment