Oracle兼容-语法-DELETE不带FROM


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

1. 语法

  1. DELETE table_name ...
  2. DELETE table_name WHERE ...

2. 示例

  1. -- 先在DEFAULT模式下测试
  2. greatsql> SET sql_mode = DEFAULT;
  3. greatsql> DELETE FROM t1 WHERE id = 1;
  4. Query OK, 0 rows affected (0.00 sec)
  5. greatsql> DELETE t1 WHERE id = 1;
  6. 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
  7. -- 切换到ORACLE模式
  8. greatsql> SET sql_mode = ORACLE;
  9. greatsql> DELETE FROM t1 WHERE id = 1;
  10. Query OK, 0 rows affected (0.00 sec)
  11. greatsql> DELETE t1 WHERE id = 1;
  12. Query OK, 0 rows affected (0.00 sec)

问题反馈

联系我们

扫码关注微信公众号

greatsql-wx