如何从表里找出一万条没关联的数据

领导给了我一个文档,文档里面有一万多条数据,全部不重复 没有关联条件,相同信息
让我从数据库表格里 找出文档里这一万多条数据。

在线求助大佬 怎么才能找到?

把这个文档数据导入到临时表,然后和数据库表关联查找出来

首先要搞清楚文档列表字段跟数据库表字段的含义,哪些字段有对应关系,然后创建一个临时表,将文档导入到这个临时表中,然后将临时表跟正式表使用连接查询得到结果,如果你对数据库不熟悉且公司内有懂这一块的,就让其协助处理下

首先用正则表达式等,将数据提取出来,导入数据库,其中不重复的部分建立主键字段
然后自己连自己做关联查询,将找到的数据删除,剩下的就是没关联的数据

1、查询相同字段的条数大于2

select * from student where

name in(select name from student group by name having COUNT(*) >=2)

2.查询某列数据的最小值不小于60

select name,kemu,chengji from student where

name in(select name from student group by name having min(chengji)>60)

3.查询平均数小于82

select name from student group by name having avg(chengji)<82

4.查询表中男女人数分别为多少

select sex ,COUNT(distinct name) from student group by sex

5.执行一个删除语句,当某列有相同时,只保留最小的这列

delete from student where ID not in(
select ID from student where chengji in(
select MIN(chengji) from student group by name))

6.查询出李姓学生平均成绩在70分以上的人

select * from student where name in(
select name from student where name like'李%' group by name having avg(chengji)>70)