Topic: SQL Queryl Help Needed

I have figured out how to bring back all posts that were deleted because of my mistake.  I'm having trouble coming up with the query to do what I want though.  If there are any sql gurus out there help me come up with this query...

Table posts
  poster_id

Table users
  id

I need to select all posts that have a poster_id, but that poster_id is not in the users table.  The poster_id in those posts, need to be set to 1.  What's the query to do that?

Re: SQL Queryl Help Needed

I've deleted your spammy bump: be a little more patient? wink

update posts set poster_id=1 where poster_id not in (select id from users)

That query may/may not work, I hold no responsibility if it messes up your install: remember to add your database prefix if necessary

Re: SQL Queryl Help Needed

Thanks sorry the post was an accident not a spammy bump honest. I was on another board both similiar.