On the difference between MySQL and Oracle

Source: Internet
Author: User


1 ID auto-grow MySQL can be set in Auto Increment,oracle is not directly set, need to be implemented by sequence.
Oracle Sequence
Create sequence Emp_sequence
Increment by 1
Start with 1
Nomaxvalue
Nocycle
Cash 10
Attention:
The first nextval returns the initial value, and the subsequent nextval automatically increases the increment by value that you define.
The added value is then returned. Currval always returns the value of the current sequence, but Currval is not used until the first nextval is initialized,
Otherwise, there will be an error. A nextval will increment the value of sequence once, so if you use multiple nextval in the same statement, the value is different.

The role of cash:
If you specify the cache value, Oracle can pre-place some sequence in memory so that it accesses faster. After the cache is finished, Oracle automatically takes
A group to the cache. Using the cache may jump, such as the database suddenly abnormal down (shutdown abort), the cache sequence will be lost.
So you can use NoCache to prevent this when the create sequence.

2 single quotation marks
MySQL supports double quote wrapping string Oracle supports single quotes only

3 page
MySQL is relatively simple only need limit n,m n start position m total number of bars
In Oracle, use RowNum Note that you cannot use a rownum> number

4th issue
Two fields in MySQL Date time
Only Date in Oracle can be converted directly to seconds via To_date or To_char ()

Current time in MySQL now () curdate () Curtime ()
Current Time in Oracle Sysdate ()

5 Handling of empty strings

6 Use of Like
Available but not efficient in Oracle string comparison function InStr (field name, ' string ') >0 effect is better

7 MySQL is auto-submit Oracle default not auto-commit

On the difference between MySQL and Oracle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.