§ Oracle兼容-语法-DELETE不带FROM


GreatSQL在ORACLE模式下支持DELETE不带FROM的语法。

§ 1. 语法

DELETE table_name ...

DELETE table_name WHERE ...
1
2
3

§ 2. 示例

-- 先在DEFAULT模式下测试
greatsql> SET sql_mode = DEFAULT;
greatsql> DELETE FROM t1 WHERE id = 1;
Query OK, 0 rows affected (0.00 sec)

greatsql> DELETE t1 WHERE id = 1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where id=1' at line 1
   
-- 切换到ORACLE模式
greatsql> SET sql_mode = ORACLE;
greatsql> DELETE FROM t1 WHERE id = 1;
Query OK, 0 rows affected (0.00 sec)
   
greatsql> DELETE t1 WHERE id = 1;
Query OK, 0 rows affected (0.00 sec)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

扫码关注微信公众号

greatsql-wx