删除带有符号“?”的行最后使用 sql 查询
Delete rows with symbol '?' at the end using sql query
我想删除连接两个表的行,这些表包含 phone 个以符号“?”结尾的数字。行如下图所示:
这是我的查询。但它显示语法错误
#1064 - 你的 SQL 语法有误;查看与您的 MariaDB 服务器版本对应的手册,了解在第 1
行附近使用 'AS A JOIN maid_3
AS B ON A.id_user = B.id_user WHERE notel LIKE '%?'' 的正确语法
DELETE FROM `maid_2` AS A
JOIN `maid_3` AS B
ON A.id_user = B.id_user
WHERE notel LIKE '%?'
我的查询有什么问题?
试试这个:
DELETE A
FROM `maid_2` AS A
JOIN `maid_3` AS B
ON A.id_user = B.id_user
WHERE notel LIKE '%?'
当删除查询中存在多个 table 时,您正尝试删除数据,而在 MariaDB 中有 Multiple-Table 的删除语法,您必须在其中提及 table 需要删除的行:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
tbl_name[.*] [, tbl_name[.*]] ...
FROM table_references
[WHERE where_condition]
有关更多信息,您可以阅读下面的内容 link:
https://mariadb.com/kb/en/delete/
我想删除连接两个表的行,这些表包含 phone 个以符号“?”结尾的数字。行如下图所示:
这是我的查询。但它显示语法错误 #1064 - 你的 SQL 语法有误;查看与您的 MariaDB 服务器版本对应的手册,了解在第 1
行附近使用 'AS A JOINmaid_3
AS B ON A.id_user = B.id_user WHERE notel LIKE '%?'' 的正确语法
DELETE FROM `maid_2` AS A
JOIN `maid_3` AS B
ON A.id_user = B.id_user
WHERE notel LIKE '%?'
我的查询有什么问题?
试试这个:
DELETE A
FROM `maid_2` AS A
JOIN `maid_3` AS B
ON A.id_user = B.id_user
WHERE notel LIKE '%?'
当删除查询中存在多个 table 时,您正尝试删除数据,而在 MariaDB 中有 Multiple-Table 的删除语法,您必须在其中提及 table 需要删除的行:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
tbl_name[.*] [, tbl_name[.*]] ...
FROM table_references
[WHERE where_condition]
有关更多信息,您可以阅读下面的内容 link:
https://mariadb.com/kb/en/delete/