oracle mysql的具体语句区别
时间: 2023-10-04 20:07:09 浏览: 90
Oracle和MySQL是两种不同的关系型数据库系统,它们的语法和语句有些不同。
下面是一些Oracle和MySQL常用语句的区别:
1.创建表:
Oracle:
```
CREATE TABLE table_name (
column1 datatype [ NULL | NOT NULL ],
column2 datatype [ NULL | NOT NULL ],
...
column_n datatype [ NULL | NOT NULL ]
);
```
MySQL:
```
CREATE TABLE table_name (
column1 datatype [ NULL | NOT NULL ],
column2 datatype [ NULL | NOT NULL ],
...
column_n datatype [ NULL | NOT NULL ]
) ENGINE=InnoDB;
```
2.插入数据:
Oracle:
```
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
```
MySQL:
```
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
```
3.更新数据:
Oracle:
```
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
```
MySQL:
```
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
```
4.删除数据:
Oracle:
```
DELETE FROM table_name
WHERE condition;
```
MySQL:
```
DELETE FROM table_name
WHERE condition;
```
还有很多其他的语句和语法区别,这里只列举了一些常用的。需要根据具体情况进行选择。
阅读全文