On Monday 20 August 2001 21:01, you wrote:
> Hi, I deleted a user from my midgard person table, and I need to change all
> referenses to the person as an author in other tables. I whant to do that
> using sql querys. Does anyone know how?
>
> what I need is something like
>
> UPDATE article.author FROM article WHERE article.id =!'person.id' or
> something like that.

UPDATE article SET author=newauthorid WHERE author=deletedauthorid.

A quick way to find orphaned articles:

SELECT article.id,article.author FROM article LEFT JOIN person ON 
article.author=person.id WHERE person.id is NULL

Emile

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to