List:General Discussion« Previous MessageNext Message »
From:Rajesh Kumar Date:August 24 2003 2:19am
Subject:Re: UPDATE based on value in another table
View as plain text  
Dan Jones unknowingly asked us:

> UPDATE table1 SET table2ID = NULL WHERE table1.table2ID NOT FOUND IN
> table2.ID;
> 
> The NOT FOUND IN isn't SQL, of course, but I'm not sure what should go
> there.

In MySql, its 'NOT IN'

and not

'NOT FOUND IN'.

To delete all references, you need to set up a Trigger.

Or else, just use multiple queries, to either delete the referenced 
columns, or to set values in them to NULL.

-- 
[ Rajesh Kumar ]
__________________________________________
Meet the guy at http://www.meetRajesh.com/

Thread
UPDATE based on value in another tableDan Jones23 Aug
  • Re: UPDATE based on value in another tableRajesh Kumar24 Aug
    • Re: UPDATE based on value in another tableDan Jones25 Aug
      • Re: UPDATE based on value in another tableotherguy26 Aug
        • InnoDB can't use system's RAM as specifiedMisaochankun26 Aug
  • Re: UPDATE based on value in another tableVictoria Reznichenko25 Aug
Re: InnoDB can't use system's RAM as specifiedHeikki Tuuri26 Aug
  • Re: InnoDB can't use system's RAM as specifiedMisao26 Aug