mysql-truncated incorrect DOUBLE value: ' Undefined '
How did I meet this problem?
I want to query the statistics from multiple tables, and save them to the table of figures, and I need to execute the SQL statement of the following structure:
Insert INTO table1 Select (select COUNT (*) from T1 where ...) c1, select (SELECT COUNT (*) from T1 where ...) c1
Executes a Select (SELECT COUNT (*) from T1 where ...) c1, select (SELECT COUNT (*) from T1 where ...) c1 no problem
Together execution will appear truncated incorrect DOUBLE value: ' Undefined '
The reason was found because:
Child Statement Select COUNT (*) from T1 where ... In the Where condition, there is a where lat! = 0
In the T1 table, the LAT is saved in the varchar format, when the LAT has a double value, it will be error:truncated incorrect Double value: ' Undefined '
How to resolve:
change where lat! = 0 to where lat! = ' 0 '
For the reasons why the Select (select COUNT (*) from T1 where ...) is executed separately c1, select (SELECT COUNT (*) from T1 where ...) c1 without an error, I don't know why.
mysql-truncated incorrect DOUBLE value: ' Undefined '