mysql 插入语句

#插入语句,列数和值的个数必须一致

INSERT INTO beauty (id,NAME,sex,borndate,phone,photo,boyfriend_id)
VALUES (13,'唐艺昕','女','1990-4-23','1898888888',NULL,2);

SELECT * FROM beauty;

INSERT INTO beauty (id,NAME,sex,borndate,phone,boyfriend_id)
VALUES (14,'金星','女','1990-4-23','1388888888',2);

INSERT INTO beauty(id,NAME,sex,phone)
VALUES(15,'娜扎','女','1377777777');

INSERT INTO beauty(NAME,sex,id,phone)
VALUES('蒋欣','女',17,'110');

省略列名,默认所有列,而且列的顺序和表中列的顺序一致

INSERT INTO beauty
VALUE(18,'张飞','男',NULL,'119',NULL,NULL);
    原文作者:wx5d21d5e6e5ab1
    原文地址: https://blog.51cto.com/14437184/2439475
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞