Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What's the difference between Oracle and Mysql?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What is the difference between Oracle and Mysql, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

The difference between Oracle and Mysql:

Oracle: both the client and the command window are determined by the user; it is a large database with a market share of 40%; the price is very high, occupying a large amount of memory space and other machine performance, and about 3G after installation

Mysql: both the client and the command window are determined by the database; it is a small and medium-sized database with a market share of 20%, open source and free, and 152m after installation.

Operational differences:

1. Rules and regulations for group functions:

The group function in MySQL can be used freely in the select statement, but if there is a group function in the query statement in Oracle, the other column names must be handled by the group function, or the column in the group by clause will report an error.

2. Automatic growth of data type processing:

MySQL has auto-growing data types. You don't have to manipulate this field when you insert a record, and you will automatically get the data value. Oracle does not have an auto-growing data type, so you need to create an auto-growing serial number, and when you insert a record, you assign the next value of the serial number to this field.

3. Handling of single quotation marks:

MySql wraps strings in double quotes and Oracle wraps strings in single quotes. Before inserting and modifying strings, you must replace single quotes: replace all occurrences of one single quote with two single quotation marks.

4. How to handle the SQL statement of turning pages:

Statement 1:

SELECT ID, [FIELD_NAME,...] FROM TABLE_NAME WHERE ID IN (SELECT ID FROM (SELECT ROWNUM AS NUMROW, ID FROM TABLE_NAME WHERE condition 1 ORDER BY condition 2) WHERE NUMROW > 80 AND NUMROW

< 100 ) ORDER BY 条件3;   语句二:   SELECT * FROM (( SELECT ROWNUM AS NUMROW, c.* from (SELECT [FIELD_NAME,...] FROM TABLE_NAME WHERE 条件1 ORDER BY 条件2) c) WHERE NUMROW >

80 AND NUMROW

< 100 ) ORDER BY 条件3;   5、长字符串的处理:   插入修改记录前一定要做进行非空和长度判断,不能为空的字段值和超出长度字段值都应该提出警告。   6、主键:   MySQL一般使用自动增长类型,在创建表时只要指定表的主键为auto increment,插入记录时,不需要再指定该记录的主键值,MySQL将自动增长;Oracle没有自动增长类型,主键一般使用的序列,插入记录时将序列号的下一个值付给该字段即可;只是ORM框架是只要是native主键生成策略即可。   7、字符串的模糊比较:   mySql里字段名like%'字符串'%,用字符串比较函数instr(字段名,'字符串')>

0 will get more accurate search results.

8. The handling of empty characters:

MySQL's non-empty fields also have empty content, and Oracle defines non-empty fields that do not allow empty content. Define the structure of the Oracle table according to the NOT NULL of MySQL, and errors will occur when importing data. Therefore, it is necessary to judge the empty character when importing the data, and if it is a NULL or empty character, you need to change it to a space string.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report