查询出有某两列相同的行:
select * from test a
where exists (
select 1
from test b
where b.学生姓名 = a.学生姓名
and b.手机号码 = a.手机号码
and (a.学校<> b.学校 or a.班级<> b.班级))
更改,合并某两项的数据:
update test1 set 手机1=(select distinct test2.手机1 from test2 where test2.学生姓名=test1.学生姓名 and test2.学号=test1.学号),
手机2=(select distinct test2.手机2 from test2 where test2.学生姓名=test1.学生姓名 and test2.学号=test1.学号)