本文共 988 字,大约阅读时间需要 3 分钟。
INSERT INTO `grade` (`id`, `math`)VALUES('1','83');
INSERT INTO grades (math)SELECT
grade
FROM student
将student表中所有的grade、level字段全部对应插入grades表中的math、java字段。
INSERT INTO grades (math,java)SELECT
grade, `level`
FROM student
INSERT INTO student (NAME, age)
VALUES
('Mary',21),
('Jack',25);
UPDATE student
SET `name` ='Mary',
`age` ='21'
WHERE
id =9;
update一次可修改多条、多列记录。
where语句是一个条件表达式,没有where语句意味着where表达式的值总是true,即表中所有记录都会被修改。
DELETEFROM student
WHERE NAME ='Jack'
转载地址:http://gcntx.baihongyu.com/