Suppose I have 2 InnoDB tables A and B.
Table A has a column named Acountry of type INT
Table B has a column named Bcountry of type VARCHAR
Some records in table A have in column Acountry values "356"
Some records in table B have in column Bcountry values "356,Italy"
How is it possible that the following join works perfectly:
(I mean I get rows where Acountry or Bcountry starts with 356)
SELECT A.Field1 , A.Field2 , B.Field3 , B.Field4
FROM A
JOIN B ON A.Acountry=B.Bcountry
despite the fact that the 2 columns have different values
and are of different type
Any hints ?
Is there any setting for "loose" joining ?
P.S.
I found this link http://bugs.mysql.com/bug.php?id=3777
where it states that:
"This is expected behavior.
The arguments (string and number) are compared as floating-point numbers"
???
Copyright License:
Author:「Portishead」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/27904944/mysql-joining-tables-on-fields-with-different-type