zoukankan      html  css  js  c++  java
  • SELECT 'www' = 0; 1

    http://dev.mysql.com/doc/refman/5.7/en/type-conversion.html

    MySQL 5.7 Reference Manual  /  Functions and Operators  /  Type Conversion in Expression Evaluation

    13.2 Type Conversion in Expression Evaluation

    When an operator is used with operands of different types, type conversion occurs to make the operands compatible. Some conversions occur implicitly. For example, MySQL automatically converts numbers to strings as necessary, and vice versa.

    It is also possible to convert a number to a string explicitly using the CAST() function. Conversion occurs implicitly with the CONCAT() function because it expects string arguments.

     1 SET FOREIGN_KEY_CHECKS=0;
     2 
     3 -- ----------------------------
     4 -- Table structure for w1
     5 -- ----------------------------
     6 DROP TABLE IF EXISTS `w1`;
     7 CREATE TABLE `w1` (
     8   `id` int(11) NOT NULL AUTO_INCREMENT,
     9   `wint` int(11) DEFAULT NULL,
    10   PRIMARY KEY (`id`)
    11 ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
    12 
    13 -- ----------------------------
    14 -- Records of w1
    15 -- ----------------------------
     1 INSERT INTO w1 (wint) VALUES ('www');
     2 INSERT INTO w1 (wint) VALUES ('wa');
     3 INSERT INTO w1 (wint) VALUES (123);
     4 
     5 
     6 
     7 
     8 
     9 
    10 
    11 SET FOREIGN_KEY_CHECKS=0;
    12 
    13 -- ----------------------------
    14 -- Table structure for w1
    15 -- ----------------------------
    16 DROP TABLE IF EXISTS `w1`;
    17 CREATE TABLE `w1` (
    18   `id` int(11) NOT NULL AUTO_INCREMENT,
    19   `wint` int(11) DEFAULT NULL,
    20   PRIMARY KEY (`id`)
    21 ) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
    22 
    23 -- ----------------------------
    24 -- Records of w1
    25 -- ----------------------------
    26 INSERT INTO `w1` VALUES ('1', '0');
    27 INSERT INTO `w1` VALUES ('2', '0');
    28 INSERT INTO `w1` VALUES ('3', '123');
  • 相关阅读:
    IIS 和 各个协议
    Hibernate 框架基本知识
    各类主流框架及设计模式简介
    PHP微信公众开发笔记(七)
    PHP微信公众开发笔记(六)
    《Programming in Lua 3》读书笔记(二十七)
    《Programming in Lua 3》读书笔记(二十八)
    《Programming in Lua 3》读书笔记(二十六)
    PHP微信公众开发笔记(五)
    PHP微信公众开发笔记(四)
  • 原文地址:https://www.cnblogs.com/rsapaper/p/6227233.html
Copyright © 2011-2022 走看看