busboy — 2013-02-20T20:41:32-05:00 — #1
Ok, so here is my latest challenge. I store outgoing emails in a table called notifications. In that table is a column called recipient, which is an email address. I recently added a new column to the notifications table called userID. Since I have the receiver's email address, I need to somehow get the userID from the user's table, and add it to the userID of the notifications table. Can someone suggest a way this can be accomplished?
busboy — 2013-02-20T20:52:01-05:00 — #2
I think I found something on the web that will work. Does this look appropriate?
UPDATE notifications, users
SET notifications.userID = users.userID
WHERE notifications.userID = 0 and notifications.recipient = users.email;