0.删除重复的数据 没有主键的
delete from imp_comid a
where a.idcard || '%'|| a.driverid in (
select a1 || '%'|| B1 from (
select t.idcard a1,min(driverid) b1 from imp_comid t group by t.idcard having count(*)>1))
1. update imp_stratwork t
set t.class=1 ,t.guid = (select i.drivid
from imp_driv_id i
where i.drivname = t.drivname and rownum<2)
2.oracle函数中有不足位数补空格的函数
LPAD和RPAD分别是左补位和右补位
repalce(lpad(字段名,共几位),‘ ’,‘0’)
如运行
select replace(lpad('123',5),' ','0') from dual
结果是00123
即补足五位 repalce(lpad(字段名,共几位),‘ ’,‘0’)
如运行
select replace(lpad('123',5),' ','0') from dual
结果是00123
3. 去空格:update imp_mani m set m.taxiid= rtrim(m.taxiid)
4.删除重复行 delete from imp_name t1 where rowid<(select max(rowid) from imp_name t2 where t1.name = t2.name)