Oracle: Difference between revisions
From Andreida
(Created page with "=== Index === Show: <pre> select * from dba_ind_columns where lower(table_name) = '<table>'; -- you only change <table> </pre> Create: <pre> create index <indexName> on <tab...") |
(No difference)
|
Latest revision as of 11:55, 16 February 2016
Index
Show:
select * from dba_ind_columns where lower(table_name) = '<table>'; -- you only change <table>
Create:
create index <indexName> on <table> (<column1>, <column2>, ...);
Drop with either
drop <indexName>;
or
alter table <table> drop constraint <indexName>;
Select
Samples:
select * from <table> sample(0.1);
Select <n> rows:
select <field1>, <field2> from (select <field1>, <field2>, row_number() over (order by <field2>) r from items) where r between 1 and <n>;