--mysql
update student s, city c
set s.city_name = c.name
where s.city_code = c.code;
--sqlserver
update t1 set t1.name = t2.name
from user_01 t1
join user_02 t2 on t1.code = t2.code
where t2.name is not null;
--mysql
update student s, city c
set s.city_name = c.name
where s.city_code = c.code;
--sqlserver
update t1 set t1.name = t2.name
from user_01 t1
join user_02 t2 on t1.code = t2.code
where t2.name is not null;
本文主要讲述在mysql数据库中,如何使用update join实现多表数据更新。
update join SQL语法如下所示:
UPDATE T1, T2
SET T1.c2 = T2.c2,
T1.c3 = T2.c3
WHERE T1.id = T2.id AND condition
或:
UPDATE T1
INNER JOIN T2 ON T1.id = T2.id
SET T1.c2 = T2.c2
T1.c3 = T2.c3
WHERE condition
vi/vim共分为三种模式,分别是一般模式,编辑模式和命令模式。
用户刚启动vi/vim,便进入了一般模式;
在一般模式下按下i就进入了编辑模式;
在一般模式下按下:就进入了命令模式;
复制:
yy 复制当前行
nyy 从光标向下复制n行
mysql或oracle语法:
create table tablenew as select * from tableold;
sqlserver语法:
select * into tablenew from tableold;
1、根据进程ID查看对应端口:
netstat -anp | grep pid
2、根据端口号查询进程ID:
netstat -tunlp | grep 8080
3、压缩/解压缩文件:
压缩文件:
zip -q -r 123.zip 123.sql -P123
解压文件:
unzip 123.zip