在PL/SQL中,查找表中多条重复记录(多个字段重复,有一个字段不重复)答:from (select 1 as c1, 2 c2 from dual union all select 1, 3 c2 from dual)group by c1 那你的问题可以这样:select id,序列号,名称,位置,WMSYS.WM_CONCAT(端口)from 表 group by id,序列号,名称,位置 这样就可以了,WMSYS.WM_CONCAT这个是类似字符串聚合函数的东东,一个缺点是重复记录不...
SQL 一条记录的的两个字段值相同与不同的查询答:create table #tb(xm varchar(20),je int,xm01 varchar(20),flag int )goinsert #tbselect '岳恒勇',2401,'刘良福',0 union allselect '刘良福',2833,'岳恒勇',1 union allselect '曹庆波',2489,'曹庆波',0 union allselect '崔世全',2407,'崔世全',1goselect * from #tbwhere exists...