I have the following MYSQL query which when executed shows me all the invalid Comment_ID
s in the table Order_Info
that don't exist in the Order_Comments
table. How would I modify this query to set the Comment_ID
value to NULL
for each record found?
SELECT Order_Info.*
FROM Order_Info
LEFT JOIN Order_Comments ON Order_Info.COMMENT_ID = Order_Comments.Comment_ID
WHERE Order_Comments.Comment_ID IS NULL
AND Order_Info.COMMENT_ID IS NOT NULL
Order_Comments table looks like this:
Comment_ID Order_Number Order_Comments
14 8989 Submitted by Gordon, Customer Se...
15 4544 Please include the cd when the b...
17 8787 Previously ordered by company, a...
23 8789 We downloaded the trial. Our is q...