The syntax difference between Oracle and MySQL in a database

Source: Internet
Author: User
Tags mysql in

Transfer from

There are not many grammatical differences between Oracle and MySQL in the database, but there are some. Here are some references:

1,oracle no offet,limit, in MySQL we use them to control the number of rows displayed, most of it is paging. If Oracle is paging, replace it with RowNum.

2,oracle Build the table, there is no auto_increment, all want to let the table of a field self-increment, to add the sequence itself, insert, the value of the sequence, inserted into.

3,oracle has a dual table when the select does not have a table, plus. No error will be added. Select 1 This will not be the error in MySQL, Oracle next. Select 1 from dual this way, Oracle does not get an error.

4, the null value of the judgment, name! = "" This will not be an error in MySQL, but Oracle will error. Under Oracle, change to name is NOT NULL

5,oracle under the single quotation marks, double quotation marks are required to be very dead, generally not used in double quotation marks, using the report

ERROR at line 1:
ORA-00904: "T": Invalid identifier

and MySQL requirements are not so strict, single quotes, double quotation marks can be.

6,oracle has to_number,to_date such a conversion function, the Oracle table field is number type, if you $_post get the parameter is 123456, when the storage, you also want to to_number to cast a bit, Otherwise it will be treated as a string. and MySQL doesn't.

7,group_concat This function, Oracle is not, if you want to use a self-written method.

8,mysql User Rights Management, is placed in the MySQL automatic band of a database MySQL inside, and Oracle is User rights are rooted in the table space walk.

9,group by, with group by under Oracle, the field behind group by must appear behind the Select, otherwise it will be an error, and MySQL will not.

10,mysql Storage Engine has a lot of, commonly used mysiam,innodb and so on, and when creating Oracle table, do not like this, as if there is only one storage engine.

11,oracle field cannot select location, ALTER TABLE Add column Before|after, this will be an error, even if you use a tool such as sql*plus, you can not change the location of the field.

12,oracle's table field type is also not MySQL much, and there are many different, for example: MySQL int,float synthesized the number type of Oracle.

13,oracle query when the from table name cannot be appended with as or will be error, select T.username from Test as T and under MySQL is possible.

There is no substring this function in 14,oracle, and MySQL has it.

The syntax difference between Oracle and MySQL in a database

Related Article

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: 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.