Issues related to the varchar field of MySQL

Source: Internet
Author: User
Problems with the varchar field of MySQL
The varchar field in MySQL, why 00555 of records are inserted when 555 is stored in the table! How do you guarantee it must be 00555?

------Solution--------------------
' Varcharfield ' = ' 00555 '

Variables with a value of 00555 note that the integer type is not
------Solution--------------------
' 00555 '
------Solution--------------------
Quotes...
------Solution--------------------
Yes, don't be so assigned:
Insert INTO (Myvarchar) VALUES (00555)
But this:
Insert INTO (Myvarchar) VALUES (' 00555 ')

------Solution--------------------
When you insert data by string, there is no case of what you are saying.
------Solution--------------------
It should be that you are not quoted when inserting, so it is treated as an int.
------Solution--------------------
Agree that's the question
  • 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.