自己常用的更新某些字段的SQL语句

1、更新院校国家代码(部标代码)

UPDATE pre_college_teacher
SET pre_college_teacher.yxdm =
(SELECT yxmc2yxdm_2.yxdm FROM yxmc2yxdm_2
WHERE 1
AND
yxmc2yxdm_2.yxmc = pre_college_teacher.yxmc
)
WHERE 1
AND pre_college_teacher.yxdm IS NULL
UPDATE pre_college_teacher
SET pre_college_teacher.yxdm =
(SELECT
pre_college_yxmc2yxdm.yxdm
FROM
pre_college_yxmc2yxdm
WHERE 1
AND
pre_college_yxmc2yxdm.yxmc =
pre_college_teacher.yxmc
)
WHERE 1
AND pre_college_teacher.yxdm
IS NULL

UPDATE pre_college_teacher_tw
SET pre_college_teacher_tw.yxdm =
(SELECT pre_college_school_tw.yxdm FROM pre_college_school_tw WHERE 1 AND pre_college_school_tw.yxmc = pre_college_teacher_tw.yxmc) WHERE 1 AND pre_college_teacher_tw.yxdm = ''

2、更新本科专业代码
UPDATE pre_college_school_major_intro
SET pre_college_school_major_intro.zydm =
(SELECT pre_chsi_zy_bk.zydm FROM pre_chsi_zy_bk WHERE 1 AND pre_chsi_zy_bk.zymc = pre_college_school_major_intro.zymc) WHERE 1 AND pre_college_school_major_intro.zycc = 1

继续阅读自己常用的更新某些字段的SQL语句

CentOS上通过iptables防火墙屏蔽IP

iptables -I INPUT -s 123.137.0.0/16 -j DROP

iptables -I INPUT -s 14.136.0.0/16 -j DROP

iptables -I INPUT -s 50.2.0.0/16 -j DROP

iptables -I INPUT -s 173.245.0.0/16 -j DROP

iptables -I INPUT -s 96.0.0.0/8 -j DROP

 

屏蔽单个IP
iptables -I INPUT -s 60.186.84.229 -j DROP

服务器上的一个网站最近被来自宁波的一个人猛烈攻击,影响了其它站点的正常运行,实在是可恶啊,干脆直接把他所在的IP段统统给屏蔽了!看你还怎么着!