List:General Discussion« Previous MessageNext Message »
From:Michael Stassen Date:May 17 2005 4:11pm
Subject:Re: why does this query work??!!!
View as plain text  
nngau@stripped wrote:

> Help! I did this query and it updated everything!
> update customer_order_history set customerID="123 456 789 0123" where
> invoiceid-12217;

WHERE expects an integer (and will convert other types to an integer). 
0 is false, null is null, everything else is true.  Hence, "WHERE 
invoiceid-12217" is true for every row where invoiceid is neither 12217 
nor null.  I expect you changed every row except the one you wanted.

> I typed a '-' rather than an '='.
> I haven't did a commit or a rollback saving point. Is there any other
> way To undo this update??

Restore from backup.

> Thanks.


re: using OR seems faster than using INJames Black17 May
  • why does this query work??!!!nngau17 May
    • Re: why does this query work??!!!mfatene17 May
    • Re: why does this query work??!!!Michael Stassen17 May
    • Re: why does this query work??!!!Peter Brawley17 May
      • RE: why does this query work??!!! - THANKS!!!nngau17 May