ORACLE中循环操作
11. PLS-00428: an INTO clause is expected in this SELECT statement
查出来的值要进行存储到变量
12. 错误提示:ORA-01403: 未找到数据
产生原因:当查询不到数据时,且把查询结果注入到定义的变量里面
13.
文章地址
14.
文章地址
15. 要操作clob类型的字段都得加上to_char(字段名)
16. oracle数据库的表中的每一行数据都有一个唯一的标识符,或者称为rowid,在oracle内部通常就是使用它来访问数据的
17. IN 函数只是or的复合简写,先执行and再执行or
18. 删除重复数据保留一个
--查找表中多余的重复记录(多个字段)
select * from tmp a
where (a.料号,a.分类码) in (select 料号,分类码 from tmp group by 料号,分类码 having count(*) > 1)--删除表中多余的重复记录(多个字段),只留有rowid最小的记录
delete from tmp a
where (a.料号,a.分类码) in (select 料号,分类码 from tmp group by 料号,分类码 having count(*) > 1)
and rowid not in (select min(rowid) from tmp group by 料号,分类码 having count(*)>1)--查找表中多余的重复记录(多个字段),不包含rowid最小的记录
select * from tmp a
where (a.料号,a.分类码) in (select 料号,分类码 from tmp group by 料号,分类码 having count(*) > 1)
and rowid not in (select min(rowid) from tmp group by 料号,分类码 having count(*)>1)
文章地址
上一篇:Linux的IO(初阶)
下一篇:TF-IDF