Oracle

From Andreida
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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>;


Links