selec * from tb A where (select count(*) from tb B where A.b=B.b)>1
你好,我试了一下,不知道是哪个地方写错了,麻烦帮我看一下 select * from (select * from test2 as b left join kdpumc0614 as a on (b.cnameb = a.cname or a.`检验项目别名` like concat('%',b.cnameb,'%') or a.`正式名称` like concat('%',b.cnameb,'%') or a.`检验项目英文名称` = b.enameb or a.`检验项目英文缩写` = b.testalias) and a.sampletype = b.sampletypeb) as c group by c having count(*)>=2
from tb A
where (select count(*) from tb B where A.b=B.b)>1
select * from (select * from test2 as b left join kdpumc0614 as a on (b.cnameb = a.cname or a.`检验项目别名` like concat('%',b.cnameb,'%') or a.`正式名称` like concat('%',b.cnameb,'%') or a.`检验项目英文名称` = b.enameb or a.`检验项目英文缩写` = b.testalias) and a.sampletype = b.sampletypeb) as c group by c having count(*)>=2
`ID` text,
`cname` text,
`检测原理` text,
`combine` text,
`normalvalue` text,
`testitemunit` text,
`sampletype` text,
`网址` text,
`检验项目别名` text,
`正式名称` text,
`相关检查` text,
`检验项目英文名称` text,
`检验项目英文缩写` text,
`检查指标分类` text,
`检查指标二级分类` text,
`卫生部目录项目名称` text,
`检测目的` text,
`何时检测` text,
`患者准备` text,
`样本采集` text,
`结果解读` text,
`详细说明` text,
`疾病标签` text,
`结果影响因素` text,
`f24` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`class_1` varchar(255) DEFAULT NULL,
`class_2` varchar(255) DEFAULT NULL,
`CNameb` varchar(50) DEFAULT NULL,
`sampletypeb` varchar(50) DEFAULT NULL,
`pinyin` varchar(100) DEFAULT NULL,
`pinyinjianxie` varchar(50) DEFAULT NULL,
`testalias` varchar(50) DEFAULT NULL,
`enameb` varchar(50) DEFAULT NULL,
`summary` text,
`TestPrinciple` text,
`TestReagent` text,
`TestOperation` text,
`NormalValueb` text,
`TestDescription` text,
`ResultEffectReason` text,
`DiseaseRelated` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8;