SQL Server VS Oracle VS MySQL

1. The most intuitive difference: Economically, SQL Server and Oracle are charged (commercial), and MySQL is open source (lightweight database).
2. Briefly talk about the difference in use:
1) Oracle and MySQL are cross-platform, and SQL Server can only be used on the Windows platform.
2) Oracle supports the decode function, the other two do not.

decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值)

3) Paging query (note sorting):
Oracle: keyword ROWNUM , nested query

SELECT * FROM  
(  
SELECT A.*, ROWNUM RN  
FROM (SELECT * FROM TABLE_NAME) A  
)  
WHERE RN BETWEEN 11[该页的起始行] AND 20 [该页的终止行]

SQLServer: Keyword TOP

SELECT  TOP  10[页大小]  *  
FROM  user_info  
WHERE  username  NOT IN(SELECT  top  10[页大小*页数] username  FROM  user_info)

Returns up to 10 rows of data starting at row 11

MySQL: keyword limit

Select  *  from  tablename  limit  m,n
即为选择从m+1开始最多n行数据
Eg.select * from table limit 10,10
返回1120行数据

4) MySQL and SQL Server have auto-growing data types. When inserting records, you do not need to operate this field, and the data value will be automatically obtained. Oracle does not have an auto-incrementing data type. It needs to create an auto-incrementing serial number. When inserting a record, the next value of the serial number should be assigned to this field. In Oracle, you need to create a sequence and then set a trigger for the table.
See https://blog.csdn.net/chinajash/article/details/1430030
for details 5) Get the current time
Oracle: SYSDATE returns the current date and time
SQL Server: getdate() returns the current date and time
MySQL: NOW() returns the current date and time, CURDATE() returns the current date, CURTIME() returns the current time

List these for now, and discover them as you use them. Currently, Oracle is mainly used.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324886462&siteId=291194637