因为效率问题,不能使用order by对结果进行排序,有没有其他方法可以使查询结果按照pk升序排列
解决方案 »
- cast转换问题
- 字段别名中怎么出现"
- Oracle语句的解释
- 如何在 if 的条件中嵌入SQL语句?
- ubuntu安装oracle11g出现问题求解惑
- oracle9客户端备份oracle8?
- 神奇的问题。SQL 错误: ORA-00911: 无效字符 00911. 00000 - "invalid character"
- oracle数据库启动问题!!是oracle专家表现的时候了!
- 关于union的问题……
- 为什么在win2000 server上不能安装ORACLE9I??
- 帮我看看这个排序 select * From Book Order by uId
- 如何在timesten中插入上万的数据?
2 nnid number(5) not null,
3 nname varchar2(20)
4 );Table createdSQL> alter table wiler_cs add primary key (nnid);Table alteredSQL> insert into wiler_cs
2 values(1,'1');1 row insertedSQL> insert into wiler_cs
2 values(10,'10');1 row insertedSQL> insert into wiler_cs
2 values(9,'9');1 row insertedSQL> insert into wiler_cs
2 values(8,'8');1 row insertedSQL> insert into wiler_cs
2 values(3,'3');1 row insertedSQL> insert into wiler_cs
2 values(5,'5');1 row insertedSQL> commit;Commit completeSQL> select * from wiler_cs; NNID NNAME
------ --------------------
1 1
10 10
9 9
8 8
3 3
5 56 rows selectedSQL> 以上是测试结果,由测试结果看出,oracle的默认排序是用rowid排序的
读的时候是通过数据块顺序的读出的
不是根据rowid排序,而是根据读出的先后顺序排序
谢谢大版
ORDER BY 主键应该不会很慢吧
第一:Distinct
第二:Group by 如果是以上的两种语句,可以不用排序。