Difference between mysql and oracle bitsCN.com
Differences between mysql and oracle
1. differences between mysql and oracle databases for auto-increment columns:
Mysql can implement auto-increment columns. you only need to set auto_increment when creating a table, but oracle cannot set auto-increment columns when creating a table,
You must use the sequence to implement the auto-incrementing column function. the Statement for creating the sequence is as follows (assuming the sequence is named ts_sequence ):
Create sequence ts_sequenceINCREMENT BY 1 -- add a few start with 1 each time -- count NOMAXVALUE from 1 -- do not set the maximum value NOCYCLE -- always accumulate, do not loop CACHE 10;
After sequence is defined, you can use ts_sequence.nextval and ts_sequence.currval in the insert statement,
Ts_sequence.currval returns the current sequence value, but it must be used after the first ts_sequence.nextval initialization.
Ts_sequence.currval.
2. differences between mysql and oracle database indexes:
In the entire database, mysql indexes can have the same name, that is, mysql indexes are table-level, but Oracle indexes cannot have the same name, that is, Oracle indexes are Database-level;
Mysql indexes start from 0 and oracle indexes start from 1.
Create index indexName on tableName (columnName); delete index mysql: alter table tableName drop index indexName oracle: drop index indexName query table index mysql: show index from tableName Oracle: select index_name, table_name, column_name from user_ind_columns where table_name = 'tablename'
BitsCN.com