标签:inner mysql 子查询 插入 date name from 查询 update
向表中插入数据,使用UNION和子查询INSERT INTO users
VALUES(1,‘a‘),
(2,‘b‘),
(3,‘c‘);
或
INSERT INTO users
SELECT 1,‘a‘ UNION
SELECT 2,‘b‘ UNION
SELECT 3,‘c‘ ;
将3号员工的last_name 修改为‘drelexer‘
UPDATE my_employees SET last_name =‘drelexer‘ WHERE id =3;
将所有工资少于900的员工的工资修改为1000
UPDATE my_employees SET salary=9000 WHERE salary<900;
将userid为Bbiri的USER表和my_employees表的记录全部删除
DELETE u,m
FROM USER u
INNER JOIN my_employees m
ON u.userid=m.userid
WHERE u.userid=‘Bbiri‘;
标签:inner mysql 子查询 插入 date name from 查询 update
原文地址:https://blog.51cto.com/14437184/2439979