with a as (select numb,name,row_number() over( partition by numb order by name desc) rowid from fenzu)select max(case when rowid=2 then name end) nam....
分类:
数据库 时间:
2015-02-28 16:08:04
阅读次数:
156
with a as(select *,row_number() over(partition by hyid order by jp desc) rowidfrom rtc)select a.hyid, max(case when a.rowid=1 then a.mc END) mc, max(c...
分类:
数据库 时间:
2015-02-28 14:21:57
阅读次数:
140
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明以下出处,否则追究版权法律责任。
深蓝的blog:
开始实验:
(1)、查询原始数据,使用scott用户进行试验
SQL> select t.*, t.rowid from EMP t
(2)、编写存储过程并执行,如下:
create or replace
procedure P_dele...
分类:
数据库 时间:
2015-02-25 18:38:35
阅读次数:
221
Row movement
从字面意思解释为行移动.默认情况下,oracle数据块中的一行其生命周期内是不会发生移动的,即其rowid不会发生改变.
但是在某些情景下,我们希望行的rowid可以发生变化,这时候我们就需要启动表的row
movement特性。
启用row movement特性,使用如下语句:
Alter table table_name enable row mov...
分类:
其他好文 时间:
2015-02-16 17:01:34
阅读次数:
327
SQL索引技术分享—内容计划ORACLE执行技术1)执行计划是什么?2)执行计划怎么分析出最佳路径?3)使用pl/sql来演示如何查看执行计划?4)执行计划的好处什么是索引?1)索引的概念2)索引相关概念,如rowid,节点图等3)如何创建索引?创建索引的实例4)如何修改索引?5)如何..
分类:
数据库 时间:
2015-02-15 13:41:41
阅读次数:
208
--oracle查找重复记录select * from tableA a where a.rowid>=(select min(rowid) from tableA b where a.column=b.column)--oracle删除重复记录delete from tableA a where ...
分类:
数据库 时间:
2015-02-05 13:14:49
阅读次数:
128
通过plsql来添加新的记录时候,出现如下错误:These query results are not updateable.Include the ROWID to get updateable results. 如截图:
解决办法如下:
第一种解决方案:select* from T_status_set for update
第二种解决方案:select tss.* ,rowid ...
分类:
其他好文 时间:
2015-01-30 10:50:40
阅读次数:
751
declare cursor mycursor is SELECT ROWID FROM tpr_zjjx1 WHERE jxrq=to_date('2013-06-30','yyyy-mm-dd') order by rowid; type rowid_table_type i...
分类:
其他好文 时间:
2015-01-29 19:29:56
阅读次数:
138
查询及删除重复记录的SQL语句
1、查找表中多余的重复记录,重复记录是根据单个字段(Id)来判断
select * from 表 where Id in (select Id from 表 group byId having count(Id) > 1)
2、删除表中多余的重复记录,重复记录是根据单个字段(Id)来判断,只留有rowid最小的记录
DELET...
分类:
数据库 时间:
2015-01-29 10:28:26
阅读次数:
223
1. 使用索引,避免在索引列上使用计算.2.用>=替代> ;(SELECTMIN(X.ROWID) FROMEMPXWHEREX.EMP_NO=E.EMP_NO);17. 避免使用大字段18.count(*)比count(1)稍快,当然如果可以通过索引检索,对索引列的计数仍旧是最快的.19.用Whe...
分类:
数据库 时间:
2015-01-26 19:12:45
阅读次数:
153