Home > database >  On the field in the MYSQL error updates for the natural logarithm of a field
On the field in the MYSQL error updates for the natural logarithm of a field

Time:10-04

In MYSQL, excuse me, ladies and gentlemen, I executed independently SELECT LN the FROM B (A) is to perform A success,

But now I need to UPDATE A field C, namely the updates for the field of A natural logarithm, UPDATE the SET B C=LN (A)

At this point the MYSQL complains and prompt the Error Code: 3020. Invalid argument for logarithm

The solution genuflect is begged

CodePudding user response:

Judge the legitimacy of the data, the select of harmonious degree is high, but the update is very strict, so I have to filter out harmonious illegal data update
 update TB set c=ln (a) where a rlike '% [^ 0-9] %'; 
  • Related