mysql-truncated incorrect DOUBLE value: ' Undefined '

Source: Internet
Author: User
Tags truncated

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 '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.