在sql命令行,删除一条记录时,发现一个很奇怪的错误
下面的语句是可以正常执行的:
delete from t_mid_test_convention where convention_id=33;
但是下面的报语法错:
delete from t_mid_test_convention as mt2 where mt2.convention_id=33;
mysql>
mysql> delete from t_mid_test_convention as mt2 where mt2.convention_id=33;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as mt2 where mt2.convention_id=33' at line 1
mysql> delete from t_mid_test_convention as mt2 where mt2.convention_id=33;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as mt2 where mt2.convention_id=33' at line 1
mysql> delete from t_mid_test_convention where convention_id=33;
Query OK, 0 rows affected (0.20 sec)
数据库版本:
Server version: 5.5.41-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.