错误代码:1109。未知表'需要'在删除声明中

时间:2016-02-24 22:11:12

标签: mysql sql-delete

delete takes
    from takes as T inner join course as C on T.course_id = C.course_id
    where title like '%database%';

我有两个表格(ID,course_id,学期,成绩)和课程(course_id,title,dept_name,credits)。每当某个单词出现在" title"中时,删除具有相同course_id的take中的行。这是我的代码,但它返回1109错误。谁知道为什么?

  

错误代码:1109。未知表&#39>需要'在这段代码的MULTI DELETE中?

1 个答案:

答案 0 :(得分:1)

我相信您收到错误的原因是您正在为表t分配别名takes,但您忘记在开头更改删除语句,所以它实际上是关于在您的查询中删除语句(takes)中没有表t的投诉。

试试这个:

delete t
    from takes as t
    inner join course as c on t.course_id = c.course_id
    where title like '%database%';
相关问题