I need to update the comments field in a table for a large list of customer_ids. The comment needs to be updated to include the existing comment and appending some text and the password which is in another table. I'm not quite sure how to do this.
Here is some code that does this for a single customer id. How would I go about doing this for a list of over 100 customer id's? my first thought is to make a temp table and place all the customer id's in there, but i'm still not sure how to code it after that since the customer_id is used in the query twice.
Update Contract
SET Contract_Comment= Contract_Comment || '; 12/29/2008 Password ' ||
(SELECT Password FROM WLogin WHERE default_customer_id='1234' ) ||'
'|| ' reinstated per Mickey Mouse;'
WHERE Customer_id='1234'