MySQL Forums
Forum List  »  Newbie

Re: Strange behaviour with the plus sign
Posted by: Pedro Tarrinho
Date: May 14, 2024 07:36AM

Thanks for replying, but I found the problem.

'' + '' is the same as 0 + 0 which is the same as 'text', which is 0

I mean, the string is being converted to integer because of the + instead of concatenating is converting to numbers (int), which means that 0 (zero) is always equal to 0 (zero).

Got it from here:
https://stackoverflow.com/questions/22080382/mysql-why-comparing-a-string-to-0-gives-true

Options: ReplyQuote


Subject
Written By
Posted
Re: Strange behaviour with the plus sign
May 14, 2024 07:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.