select distinct max(t1.recnum) from pre_house t1 group by t1.rightcertnum
查询出617select distinct t1.recnum from pre_house t1
查询出记录678
delete from pre_house where recnum not in(select distinct max(t1.recnum) from pre_house t1 group by t1.rightcertnum)
怎么删除0条记录呢????
查询出617select distinct t1.recnum from pre_house t1
查询出记录678
delete from pre_house where recnum not in(select distinct max(t1.recnum) from pre_house t1 group by t1.rightcertnum)
怎么删除0条记录呢????
select distinct t1.recnum from pre_house t1 group by t1.rightcertnum查出是多少
delete from pre_house t2 where t2.recnum not in(select distinct max(t1.recnum) from pre_house t1 group by t1.rightcertnum)
delete from pre_house t2
where t2.recnum not in (select max(t1.recnum) from pre_house t1 )
这样不就可以了吗?