一般来说是主键中存在null
select *
from RPMFIX.SYSOTVS
where COMPANYCODE is null
or COUNTRYAREACODE is null
or SLIPNO is null
or LINENO is null
or SEQNO is null
or DATATYPE is null
查出来后自行判断删除与否
另一种就是有重复主键的数据,直接删除算了
delete from RPMFIX.SYSOTVS x
where x.rowid > (select min(rowid)
from RPMFIX.SYSOTVS y
where x.COMPANYCODE = y.COMPANYCODE
and x.COUNTRYAREACODE = y.COUNTRYAREACODE
and x.SLIPNO = y.SLIPNO
and x.LINENO = y.LINENO
and x.SEQNO = y.SEQNO
and x.DATATYPE = y.DATATYPE);