mysql

作者: c667ec5a71d8 | 来源:发表于2019-06-07 00:03 被阅读0次

    尝试以下实例:

    创建数据表 runoob_test_tbl

    root@host# mysql -u root -p password;

    Enter password:*******

    mysql> use RUNOOB;

    Database changed

    mysql> create table runoob_test_tbl

        -> (

        -> runoob_author varchar(40) NOT NULL,

        -> runoob_count  INT

        -> );

    Query OK, 0 rows affected (0.05 sec)

    mysql> INSERT INTO runoob_test_tbl (runoob_author, runoob_count) values ('RUNOOB', 20);

    mysql> INSERT INTO runoob_test_tbl (runoob_author, runoob_count) values ('菜鸟教程', NULL);

    mysql> INSERT INTO runoob_test_tbl (runoob_author, runoob_count) values ('Google', NULL);

    mysql> INSERT INTO runoob_test_tbl (runoob_author, runoob_count) values ('FK', 20);

    mysql> SELECT * from runoob_test_tbl;

    +---------------+--------------+

    | runoob_author | runoob_count |

    +---------------+--------------+

    | RUNOOB        | 20          |

    | 菜鸟教程  | NULL        |

    | Google        | NULL        |

    | FK            | 20          |

    +---------------+--------------+

    4 rows in set (0.01 sec)

    以下实例中你可以看到 = 和 != 运算符是不起作用的:

    相关文章

      网友评论

          本文标题:mysql

          本文链接:https://www.haomeiwen.com/subject/hgbpxctx.html